Refactoring jitter_buffer.h/.cc to Google style.

BUG=

Review URL: https://webrtc-codereview.appspot.com/872006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2920 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org
2012-10-12 07:04:52 +00:00
parent df42df5bd6
commit 912981fd0c
7 changed files with 1540 additions and 1868 deletions

View File

@@ -199,7 +199,7 @@ VCMFrameBuffer::InsertPacket(const VCMPacket& packet, WebRtc_Word64 timeInMs,
} }
WebRtc_Word64 WebRtc_Word64
VCMFrameBuffer::LatestPacketTimeMs() VCMFrameBuffer::LatestPacketTimeMs() const
{ {
return _latestPacketTimeMs; return _latestPacketTimeMs;
} }

View File

@@ -74,7 +74,7 @@ public:
void IncrementNackCount(); void IncrementNackCount();
WebRtc_Word16 GetNackCount() const; WebRtc_Word16 GetNackCount() const;
WebRtc_Word64 LatestPacketTimeMs(); WebRtc_Word64 LatestPacketTimeMs() const;
webrtc::FrameType FrameType() const; webrtc::FrameType FrameType() const;
void SetPreviousFrameLoss(); void SetPreviousFrameLoss();

File diff suppressed because it is too large Load Diff

View File

@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#ifndef WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_ #ifndef WEBRTC_MODULES_VIDEO_CODING_MAIN_SOURCE_JITTER_BUFFER_H_
#define WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_ #define WEBRTC_MODULES_VIDEO_CODING_MAIN_SOURCE_JITTER_BUFFER_H_
#include <list> #include <list>
@@ -24,14 +24,12 @@
#include "system_wrappers/interface/critical_section_wrapper.h" #include "system_wrappers/interface/critical_section_wrapper.h"
#include "typedefs.h" #include "typedefs.h"
namespace webrtc namespace webrtc {
{
enum VCMNackMode enum VCMNackMode {
{ kNackInfinite,
kNackInfinite, kNackHybrid,
kNackHybrid, kNoNack
kNoNack
}; };
typedef std::list<VCMFrameBuffer*> FrameList; typedef std::list<VCMFrameBuffer*> FrameList;
@@ -42,218 +40,227 @@ class VCMFrameBuffer;
class VCMPacket; class VCMPacket;
class VCMEncodedFrame; class VCMEncodedFrame;
class VCMJitterSample struct VCMJitterSample {
{ VCMJitterSample() : timestamp(0), frame_size(0), latest_packet_time(-1) {}
public: uint32_t timestamp;
VCMJitterSample() : timestamp(0), frameSize(0), latestPacketTime(-1) {} uint32_t frame_size;
WebRtc_UWord32 timestamp; int64_t latest_packet_time;
WebRtc_UWord32 frameSize;
WebRtc_Word64 latestPacketTime;
}; };
class VCMJitterBuffer class VCMJitterBuffer {
{ public:
public: VCMJitterBuffer(TickTimeBase* clock, int vcm_id = -1, int receiver_id = -1,
VCMJitterBuffer(TickTimeBase* clock, bool master = true);
WebRtc_Word32 vcmId = -1, virtual ~VCMJitterBuffer();
WebRtc_Word32 receiverId = -1,
bool master = true);
virtual ~VCMJitterBuffer();
void CopyFrom(const VCMJitterBuffer& rhs); // Makes |this| a deep copy of |rhs|.
void CopyFrom(const VCMJitterBuffer& rhs);
// We need a start and stop to break out of the wait event // Initializes and starts jitter buffer.
// used in GetCompleteFrameForDecoding void Start();
void Start();
void Stop();
bool Running() const;
// Empty the Jitter buffer of all its data // Signals all internal events and stops the jitter buffer.
void Flush(); void Stop();
// Statistics, Get received key and delta frames // Returns true if the jitter buffer is running.
WebRtc_Word32 GetFrameStatistics(WebRtc_UWord32& receivedDeltaFrames, bool Running() const;
WebRtc_UWord32& receivedKeyFrames) const;
// The number of packets discarded by the jitter buffer because the decoder // Empty the jitter buffer of all its data.
// won't be able to decode them. void Flush();
WebRtc_UWord32 NumNotDecodablePackets() const;
// Get number of packets discarded by the jitter buffer
WebRtc_UWord32 DiscardedPackets() const;
// Statistics, Calculate frame and bit rates // Get the number of received key and delta frames since the jitter buffer
WebRtc_Word32 GetUpdate(WebRtc_UWord32& frameRate, WebRtc_UWord32& bitRate); // was started.
void FrameStatistics(uint32_t* received_delta_frames,
uint32_t* received_key_frames) const;
// Wait for the first packet in the next frame to arrive, blocks // The number of packets discarded by the jitter buffer because the decoder
// for <= maxWaitTimeMS ms // won't be able to decode them.
WebRtc_Word64 GetNextTimeStamp(WebRtc_UWord32 maxWaitTimeMS, int num_not_decodable_packets() const;
FrameType& incomingFrameType,
WebRtc_Word64& renderTimeMs);
// Will the packet sequence be complete if the next frame is grabbed // Gets number of packets discarded by the jitter buffer.
// for decoding right now? That is, have we lost a frame between the int num_discarded_packets() const;
// last decoded frame and the next, or is the next frame missing one
// or more packets?
bool CompleteSequenceWithNextFrame();
// TODO (mikhal/stefan): Merge all GetFrameForDecoding into one. // Statistics, Calculate frame and bit rates.
// Wait maxWaitTimeMS for a complete frame to arrive. After timeout NULL void IncomingRateStatistics(unsigned int* framerate,
// is returned. unsigned int* bitrate);
VCMEncodedFrame* GetCompleteFrameForDecoding(WebRtc_UWord32 maxWaitTimeMS);
// Get a frame for decoding (even an incomplete) without delay. // Waits for the first packet in the next frame to arrive and then returns
VCMEncodedFrame* GetFrameForDecoding(); // the timestamp of that frame. |incoming_frame_type| and |render_time_ms| are
// set to the frame type and render time of the next frame.
// Blocks for up to |max_wait_time_ms| ms. Returns -1 if no packet has arrived
// after |max_wait_time_ms| ms.
int64_t NextTimestamp(uint32_t max_wait_time_ms,
FrameType* incoming_frame_type,
int64_t* render_time_ms);
VCMEncodedFrame* GetFrameForDecodingNACK(); // Checks if the packet sequence will be complete if the next frame would be
// grabbed for decoding. That is, if a frame has been lost between the
// last decoded frame and the next, or if the next frame is missing one
// or more packets.
bool CompleteSequenceWithNextFrame();
// Release frame (when done with decoding) // TODO(mikhal/stefan): Merge all GetFrameForDecoding into one.
void ReleaseFrame(VCMEncodedFrame* frame); // Wait |max_wait_time_ms| for a complete frame to arrive. After timeout NULL
// is returned.
VCMEncodedFrame* GetCompleteFrameForDecoding(uint32_t max_wait_time_ms);
// Get frame to use for this timestamp // Get a frame for decoding (even an incomplete) without delay.
WebRtc_Word32 GetFrame(const VCMPacket& packet, VCMEncodedFrame*&); VCMEncodedFrame* GetFrameForDecoding();
VCMEncodedFrame* GetFrame(const VCMPacket& packet); // deprecated
// Returns the time in ms when the latest packet was inserted into the frame. // Releases a frame returned from the jitter buffer, should be called when
// Retransmitted is set to true if any of the packets belonging to the frame // done with decoding.
// has been retransmitted. void ReleaseFrame(VCMEncodedFrame* frame);
WebRtc_Word64 LastPacketTime(VCMEncodedFrame* frame,
bool& retransmitted) const;
// Insert a packet into a frame // Returns the frame assigned to this timestamp.
VCMFrameBufferEnum InsertPacket(VCMEncodedFrame* frame, int GetFrame(const VCMPacket& packet, VCMEncodedFrame*&);
const VCMPacket& packet); VCMEncodedFrame* GetFrame(const VCMPacket& packet); // Deprecated.
// Sync // Returns the time in ms when the latest packet was inserted into the frame.
WebRtc_UWord32 GetEstimatedJitterMS(); // Retransmitted is set to true if any of the packets belonging to the frame
void UpdateRtt(WebRtc_UWord32 rttMs); // has been retransmitted.
int64_t LastPacketTime(VCMEncodedFrame* frame, bool* retransmitted) const;
// NACK // Inserts a packet into a frame returned from GetFrame().
// Set the NACK mode. "highRttNackThreshold" is an RTT threshold in ms above VCMFrameBufferEnum InsertPacket(VCMEncodedFrame* frame,
// which NACK will be disabled if the NACK mode is "kNackHybrid", const VCMPacket& packet);
// -1 meaning that NACK is always enabled in the Hybrid mode.
// "lowRttNackThreshold" is an RTT threshold in ms below which we expect to
// rely on NACK only, and therefore are using larger buffers to have time to
// wait for retransmissions.
void SetNackMode(VCMNackMode mode,
int lowRttNackThresholdMs,
int highRttNackThresholdMs);
VCMNackMode GetNackMode() const; // Get nack mode
// Get list of missing sequence numbers (size in number of elements)
WebRtc_UWord16* GetNackList(WebRtc_UWord16& nackSize,
bool& listExtended);
WebRtc_Word64 LastDecodedTimestamp() const; // Returns the estimated jitter in milliseconds.
uint32_t EstimatedJitterMs();
private: // Updates the round-trip time estimate.
// Misc help functions void UpdateRtt(uint32_t rtt_ms);
// Recycle (release) frame, used if we didn't receive whole frame
void RecycleFrame(VCMFrameBuffer* frame);
void ReleaseFrameInternal(VCMFrameBuffer* frame);
// Flush and reset the jitter buffer. Call under critical section.
void FlushInternal();
// Help functions for insert packet // Set the NACK mode. |highRttNackThreshold| is an RTT threshold in ms above
// Get empty frame, creates new (i.e. increases JB size) if necessary // which NACK will be disabled if the NACK mode is |kNackHybrid|, -1 meaning
VCMFrameBuffer* GetEmptyFrame(); // that NACK is always enabled in the hybrid mode.
// Recycle oldest frames up to a key frame, used if JB is completely full // |lowRttNackThreshold| is an RTT threshold in ms below which we expect to
bool RecycleFramesUntilKeyFrame(); // rely on NACK only, and therefore are using larger buffers to have time to
// Update frame state // wait for retransmissions.
// (set as complete or reconstructable if conditions are met) void SetNackMode(VCMNackMode mode, int low_rtt_nack_threshold_ms,
VCMFrameBufferEnum UpdateFrameState(VCMFrameBuffer* frameListItem); int high_rtt_nack_threshold_ms);
// Help functions for getting a frame // Returns the current NACK mode.
// Find oldest complete frame, used for getting next frame to decode VCMNackMode nack_mode() const;
// When enabled, will return a decodable frame
FrameList::iterator FindOldestCompleteContinuousFrame(bool enableDecodable);
void CleanUpOldFrames(); // Creates a list of missing sequence numbers.
uint16_t* CreateNackList(uint16_t* nack_list_size, bool* list_extended);
void VerifyAndSetPreviousFrameLost(VCMFrameBuffer& frame); int64_t LastDecodedTimestamp() const;
bool IsPacketRetransmitted(const VCMPacket& packet) const;
void UpdateJitterAndDelayEstimates(VCMJitterSample& sample, private:
bool incompleteFrame); // In NACK-only mode this function doesn't return or release non-complete
void UpdateJitterAndDelayEstimates(VCMFrameBuffer& frame, // frames unless we have a complete key frame. In hybrid mode, we may release
bool incompleteFrame); // "decodable", incomplete frames.
void UpdateJitterAndDelayEstimates(WebRtc_Word64 latestPacketTimeMs, VCMEncodedFrame* GetFrameForDecodingNACK();
WebRtc_UWord32 timestamp,
WebRtc_UWord32 frameSize,
bool incompleteFrame);
void UpdateOldJitterSample(const VCMPacket& packet);
WebRtc_UWord32 GetEstimatedJitterMsInternal();
// NACK help void ReleaseFrameIfNotDecoding(VCMFrameBuffer* frame);
WebRtc_UWord16* CreateNackList(WebRtc_UWord16& nackSize,
bool& listExtended);
WebRtc_Word32 GetLowHighSequenceNumbers(WebRtc_Word32& lowSeqNum,
WebRtc_Word32& highSeqNum) const;
// Decide whether should wait for NACK (mainly relevant for hybrid mode) // Gets an empty frame, creating a new frame if necessary (i.e. increases
bool WaitForNack(); // jitter buffer size).
VCMFrameBuffer* GetEmptyFrame();
WebRtc_Word32 _vcmId; // Recycles oldest frames until a key frame is found. Used if jitter buffer is
WebRtc_Word32 _receiverId; // completely full. Returns true if a key frame was found.
TickTimeBase* _clock; bool RecycleFramesUntilKeyFrame();
// If we are running (have started) or not
bool _running;
CriticalSectionWrapper* _critSect;
bool _master;
// Event to signal when we have a frame ready for decoder
VCMEvent _frameEvent;
// Event to signal when we have received a packet
VCMEvent _packetEvent;
// Number of allocated frames
WebRtc_Word32 _maxNumberOfFrames;
// Array of pointers to the frames in JB
VCMFrameBuffer* _frameBuffers[kMaxNumberOfFrames];
FrameList _frameList;
// timing // Sets the state of |frame| to complete if it's not too old to be decoded.
VCMDecodingState _lastDecodedState; // Also updates the frame statistics. Signals the |frame_event| if this is
WebRtc_UWord32 _packetsNotDecodable; // the next frame to be decoded.
VCMFrameBufferEnum UpdateFrameState(VCMFrameBuffer* frame);
// Statistics // Finds the oldest complete frame, used for getting next frame to decode.
// Frame counter for each type (key, delta, golden, key-delta) // Can return a decodable, incomplete frame if |enable_decodable| is true.
WebRtc_UWord8 _receiveStatistics[4]; FrameList::iterator FindOldestCompleteContinuousFrame(bool enable_decodable);
// Latest calculated frame rates of incoming stream
WebRtc_UWord8 _incomingFrameRate;
// Frame counter, reset in GetUpdate
WebRtc_UWord32 _incomingFrameCount;
// Real time for last _frameCount reset
WebRtc_Word64 _timeLastIncomingFrameCount;
// Received bits counter, reset in GetUpdate
WebRtc_UWord32 _incomingBitCount;
WebRtc_UWord32 _incomingBitRate;
WebRtc_UWord32 _dropCount; // Frame drop counter
// Number of frames in a row that have been too old
WebRtc_UWord32 _numConsecutiveOldFrames;
// Number of packets in a row that have been too old
WebRtc_UWord32 _numConsecutiveOldPackets;
// Number of packets discarded by the jitter buffer
WebRtc_UWord32 _discardedPackets;
// Filters for estimating jitter void CleanUpOldFrames();
VCMJitterEstimator _jitterEstimate;
// Calculates network delays used for jitter calculations
VCMInterFrameDelay _delayEstimate;
VCMJitterSample _waitingForCompletion;
WebRtc_UWord32 _rttMs;
// NACK // Sets the "decodable" and "frame loss" flags of a frame depending on which
VCMNackMode _nackMode; // packets have been received and which are missing.
int _lowRttNackThresholdMs; // A frame is "decodable" if enough packets of that frame has been received
int _highRttNackThresholdMs; // for it to be usable by the decoder.
// Holds the internal nack list (the missing sequence numbers) // A frame has the "frame loss" flag set if packets are missing after the
WebRtc_Word32 _NACKSeqNumInternal[kNackHistoryLength]; // last decoded frame and before |frame|.
WebRtc_UWord16 _NACKSeqNum[kNackHistoryLength]; void VerifyAndSetPreviousFrameLost(VCMFrameBuffer* frame);
WebRtc_UWord32 _NACKSeqNumLength;
bool _waitingForKeyFrame;
bool _firstPacket; // Returns true if |packet| is likely to have been retransmitted.
bool IsPacketRetransmitted(const VCMPacket& packet) const;
DISALLOW_COPY_AND_ASSIGN(VCMJitterBuffer); // The following three functions update the jitter estimate with the
// payload size, receive time and RTP timestamp of a frame.
void UpdateJitterEstimate(const VCMJitterSample& sample,
bool incomplete_frame);
void UpdateJitterEstimate(const VCMFrameBuffer& frame, bool incomplete_frame);
void UpdateJitterEstimate(int64_t latest_packet_time_ms,
uint32_t timestamp,
unsigned int frame_size,
bool incomplete_frame);
// Returns the lowest and highest known sequence numbers, where the lowest is
// the last decoded sequence number if a frame has been decoded.
// -1 is returned if a sequence number cannot be determined.
void GetLowHighSequenceNumbers(int32_t* low_seq_num,
int32_t* high_seq_num) const;
// Returns true if we should wait for retransmissions, false otherwise.
bool WaitForRetransmissions();
int vcm_id_;
int receiver_id_;
TickTimeBase* clock_;
// If we are running (have started) or not.
bool running_;
CriticalSectionWrapper* crit_sect_;
bool master_;
// Event to signal when we have a frame ready for decoder.
VCMEvent frame_event_;
// Event to signal when we have received a packet.
VCMEvent packet_event_;
// Number of allocated frames.
int max_number_of_frames_;
// Array of pointers to the frames in jitter buffer.
VCMFrameBuffer* frame_buffers_[kMaxNumberOfFrames];
FrameList frame_list_;
VCMDecodingState last_decoded_state_;
bool first_packet_;
// Statistics.
int num_not_decodable_packets_;
// Frame counter for each type (key, delta, golden, key-delta).
unsigned int receive_statistics_[4];
// Latest calculated frame rates of incoming stream.
unsigned int incoming_frame_rate_;
unsigned int incoming_frame_count_;
int64_t time_last_incoming_frame_count_;
unsigned int incoming_bit_count_;
unsigned int incoming_bit_rate_;
unsigned int drop_count_; // Frame drop counter.
// Number of frames in a row that have been too old.
int num_consecutive_old_frames_;
// Number of packets in a row that have been too old.
int num_consecutive_old_packets_;
// Number of packets discarded by the jitter buffer.
int num_discarded_packets_;
// Jitter estimation.
// Filter for estimating jitter.
VCMJitterEstimator jitter_estimate_;
// Calculates network delays used for jitter calculations.
VCMInterFrameDelay inter_frame_delay_;
VCMJitterSample waiting_for_completion_;
WebRtc_UWord32 rtt_ms_;
// NACK and retransmissions.
VCMNackMode nack_mode_;
int low_rtt_nack_threshold_ms_;
int high_rtt_nack_threshold_ms_;
// Holds the internal NACK list (the missing sequence numbers).
int32_t nack_seq_nums_internal_[kNackHistoryLength];
uint16_t nack_seq_nums_[kNackHistoryLength];
unsigned int nack_seq_nums_length_;
bool waiting_for_key_frame_;
DISALLOW_COPY_AND_ASSIGN(VCMJitterBuffer);
}; };
} // namespace webrtc
} // namespace webrtc #endif // WEBRTC_MODULES_VIDEO_CODING_MAIN_SOURCE_JITTER_BUFFER_H_
#endif // WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_

View File

@@ -287,7 +287,8 @@ TEST_F(TestJitterBufferNack, TestNackListFull) {
uint16_t nack_list_length = kNackHistoryLength; uint16_t nack_list_length = kNackHistoryLength;
bool extended; bool extended;
uint16_t* nack_list = jitter_buffer_->GetNackList(nack_list_length, extended); uint16_t* nack_list = jitter_buffer_->CreateNackList(&nack_list_length,
&extended);
// Verify that the jitter buffer requests a key frame. // Verify that the jitter buffer requests a key frame.
EXPECT_TRUE(nack_list_length == 0xffff && nack_list == NULL); EXPECT_TRUE(nack_list_length == 0xffff && nack_list == NULL);
@@ -302,14 +303,14 @@ TEST_F(TestJitterBufferNack, TestNackBeforeDecode) {
InsertFrame(kVideoFrameDelta); InsertFrame(kVideoFrameDelta);
uint16_t nack_list_size = 0; uint16_t nack_list_size = 0;
bool extended = false; bool extended = false;
uint16_t* list = jitter_buffer_->GetNackList(nack_list_size, extended); uint16_t* list = jitter_buffer_->CreateNackList(&nack_list_size, &extended);
// No list generated, and a key frame request is signaled. // No list generated, and a key frame request is signaled.
EXPECT_TRUE(list == NULL); EXPECT_TRUE(list == NULL);
EXPECT_EQ(0xFFFF, nack_list_size); EXPECT_EQ(0xFFFF, nack_list_size);
} }
TEST_F(TestJitterBufferNack, TestNormalOperation) { TEST_F(TestJitterBufferNack, TestNormalOperation) {
EXPECT_EQ(kNackInfinite, jitter_buffer_->GetNackMode()); EXPECT_EQ(kNackInfinite, jitter_buffer_->nack_mode());
InsertFrame(kVideoFrameKey); InsertFrame(kVideoFrameKey);
EXPECT_TRUE(DecodeFrame()); EXPECT_TRUE(DecodeFrame());
@@ -335,7 +336,7 @@ TEST_F(TestJitterBufferNack, TestNormalOperation) {
EXPECT_FALSE(DecodeFrame()); EXPECT_FALSE(DecodeFrame());
uint16_t nack_list_size = 0; uint16_t nack_list_size = 0;
bool extended = false; bool extended = false;
uint16_t* list = jitter_buffer_->GetNackList(nack_list_size, extended); uint16_t* list = jitter_buffer_->CreateNackList(&nack_list_size, &extended);
// Verify the NACK list. // Verify the NACK list.
const int kExpectedNackSize = 9; const int kExpectedNackSize = 9;
ASSERT_EQ(kExpectedNackSize, nack_list_size); ASSERT_EQ(kExpectedNackSize, nack_list_size);
@@ -365,7 +366,7 @@ TEST_F(TestJitterBufferNack, TestNormalOperationWrap) {
EXPECT_FALSE(DecodeCompleteFrame()); EXPECT_FALSE(DecodeCompleteFrame());
uint16_t nack_list_size = 0; uint16_t nack_list_size = 0;
bool extended = false; bool extended = false;
uint16_t* list = jitter_buffer_->GetNackList(nack_list_size, extended); uint16_t* list = jitter_buffer_->CreateNackList(&nack_list_size, &extended);
// Verify the NACK list. // Verify the NACK list.
const int kExpectedNackSize = 10; const int kExpectedNackSize = 10;
ASSERT_EQ(kExpectedNackSize, nack_list_size); ASSERT_EQ(kExpectedNackSize, nack_list_size);

View File

@@ -200,9 +200,9 @@ VCMEncodedFrame* VCMReceiver::FrameForDecoding(WebRtc_UWord16 maxWaitTimeMs,
FrameType incomingFrameType = kVideoFrameDelta; FrameType incomingFrameType = kVideoFrameDelta;
nextRenderTimeMs = -1; nextRenderTimeMs = -1;
const WebRtc_Word64 startTimeMs = _clock->MillisecondTimestamp(); const WebRtc_Word64 startTimeMs = _clock->MillisecondTimestamp();
WebRtc_Word64 ret = _jitterBuffer.GetNextTimeStamp(maxWaitTimeMs, WebRtc_Word64 ret = _jitterBuffer.NextTimestamp(maxWaitTimeMs,
incomingFrameType, &incomingFrameType,
nextRenderTimeMs); &nextRenderTimeMs);
if (ret < 0) if (ret < 0)
{ {
// No timestamp in jitter buffer at the moment // No timestamp in jitter buffer at the moment
@@ -211,7 +211,7 @@ VCMEncodedFrame* VCMReceiver::FrameForDecoding(WebRtc_UWord16 maxWaitTimeMs,
const WebRtc_UWord32 timeStamp = static_cast<WebRtc_UWord32>(ret); const WebRtc_UWord32 timeStamp = static_cast<WebRtc_UWord32>(ret);
// Update the timing // Update the timing
_timing.SetRequiredDelay(_jitterBuffer.GetEstimatedJitterMS()); _timing.SetRequiredDelay(_jitterBuffer.EstimatedJitterMs());
_timing.UpdateCurrentDelay(timeStamp); _timing.UpdateCurrentDelay(timeStamp);
const WebRtc_Word32 tempWaitTime = maxWaitTimeMs - const WebRtc_Word32 tempWaitTime = maxWaitTimeMs -
@@ -233,7 +233,7 @@ VCMEncodedFrame* VCMReceiver::FrameForDecoding(WebRtc_UWord16 maxWaitTimeMs,
{ {
bool retransmitted = false; bool retransmitted = false;
const WebRtc_Word64 lastPacketTimeMs = const WebRtc_Word64 lastPacketTimeMs =
_jitterBuffer.LastPacketTime(frame, retransmitted); _jitterBuffer.LastPacketTime(frame, &retransmitted);
if (lastPacketTimeMs >= 0 && !retransmitted) if (lastPacketTimeMs >= 0 && !retransmitted)
{ {
// We don't want to include timestamps which have suffered from retransmission // We don't want to include timestamps which have suffered from retransmission
@@ -367,20 +367,21 @@ VCMReceiver::ReleaseFrame(VCMEncodedFrame* frame)
WebRtc_Word32 WebRtc_Word32
VCMReceiver::ReceiveStatistics(WebRtc_UWord32& bitRate, WebRtc_UWord32& frameRate) VCMReceiver::ReceiveStatistics(WebRtc_UWord32& bitRate, WebRtc_UWord32& frameRate)
{ {
const WebRtc_Word32 ret = _jitterBuffer.GetUpdate(frameRate, bitRate); _jitterBuffer.IncomingRateStatistics(&frameRate, &bitRate);
bitRate /= 1000; // Should be in kbps bitRate /= 1000; // Should be in kbps
return ret; return 0;
} }
WebRtc_Word32 WebRtc_Word32
VCMReceiver::ReceivedFrameCount(VCMFrameCount& frameCount) const VCMReceiver::ReceivedFrameCount(VCMFrameCount& frameCount) const
{ {
return _jitterBuffer.GetFrameStatistics(frameCount.numDeltaFrames, _jitterBuffer.FrameStatistics(&frameCount.numDeltaFrames,
frameCount.numKeyFrames); &frameCount.numKeyFrames);
return 0;
} }
WebRtc_UWord32 VCMReceiver::DiscardedPackets() const { WebRtc_UWord32 VCMReceiver::DiscardedPackets() const {
return _jitterBuffer.DiscardedPackets(); return _jitterBuffer.num_discarded_packets();
} }
void void
@@ -399,7 +400,7 @@ VCMNackMode
VCMReceiver::NackMode() const VCMReceiver::NackMode() const
{ {
CriticalSectionScoped cs(_critSect); CriticalSectionScoped cs(_critSect);
return _jitterBuffer.GetNackMode(); return _jitterBuffer.nack_mode();
} }
VCMNackStatus VCMNackStatus
@@ -407,7 +408,8 @@ VCMReceiver::NackList(WebRtc_UWord16* nackList, WebRtc_UWord16& size)
{ {
bool extended = false; bool extended = false;
WebRtc_UWord16 nackListSize = 0; WebRtc_UWord16 nackListSize = 0;
WebRtc_UWord16* internalNackList = _jitterBuffer.GetNackList(nackListSize, extended); WebRtc_UWord16* internalNackList = _jitterBuffer.CreateNackList(
&nackListSize, &extended);
if (internalNackList == NULL && nackListSize == 0xffff) if (internalNackList == NULL && nackListSize == 0xffff)
{ {
// This combination is used to trigger key frame requests. // This combination is used to trigger key frame requests.
@@ -468,7 +470,7 @@ VCMReceiver::UpdateState(VCMReceiverState newState)
void void
VCMReceiver::UpdateState(VCMEncodedFrame& frame) VCMReceiver::UpdateState(VCMEncodedFrame& frame)
{ {
if (_jitterBuffer.GetNackMode() == kNoNack) if (_jitterBuffer.nack_mode() == kNoNack)
{ {
// Dual decoder mode has not been enabled. // Dual decoder mode has not been enabled.
return; return;

View File

@@ -135,13 +135,9 @@ int JitterBufferTest(CmdArgs& args)
} }
} }
// Test out of range inputs
TEST(kSizeError == jb.InsertPacket(0, packet));
jb.ReleaseFrame(0);
// Not started // Not started
TEST(0 == jb.GetFrame(packet)); TEST(0 == jb.GetFrame(packet));
TEST(-1 == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(-1 == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
TEST(0 == jb.GetCompleteFrameForDecoding(10)); TEST(0 == jb.GetCompleteFrameForDecoding(10));
TEST(0 == jb.GetFrameForDecoding()); TEST(0 == jb.GetFrameForDecoding());
@@ -179,7 +175,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -220,7 +216,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -279,7 +275,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameKey); TEST(incomingFrameType == kVideoFrameKey);
@@ -355,7 +351,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -432,7 +428,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -509,7 +505,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -550,7 +546,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -624,7 +620,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -686,7 +682,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -728,14 +724,14 @@ int JitterBufferTest(CmdArgs& args)
// //
WebRtc_UWord32 numDeltaFrames = 0; WebRtc_UWord32 numDeltaFrames = 0;
WebRtc_UWord32 numKeyFrames = 0; WebRtc_UWord32 numKeyFrames = 0;
TEST(jb.GetFrameStatistics(numDeltaFrames, numKeyFrames) == 0); jb.FrameStatistics(&numDeltaFrames, &numKeyFrames);
TEST(numDeltaFrames == 8); TEST(numDeltaFrames == 8);
TEST(numKeyFrames == 1); TEST(numKeyFrames == 1);
WebRtc_UWord32 frameRate; WebRtc_UWord32 frameRate;
WebRtc_UWord32 bitRate; WebRtc_UWord32 bitRate;
TEST(jb.GetUpdate(frameRate, bitRate) == 0); jb.IncomingRateStatistics(&frameRate, &bitRate);
// these depend on CPU speed works on a T61 // these depend on CPU speed works on a T61
TEST(frameRate > 30); TEST(frameRate > 30);
@@ -786,8 +782,8 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// Get packet notification // Get packet notification
TEST(timeStamp - 33 * 90 == jb.GetNextTimeStamp(10, incomingFrameType, TEST(timeStamp - 33 * 90 == jb.NextTimestamp(10, &incomingFrameType,
renderTimeMs)); &renderTimeMs));
// Check incoming frame type // Check incoming frame type
if (i == 0) if (i == 0)
@@ -858,7 +854,7 @@ int JitterBufferTest(CmdArgs& args)
jb.ReleaseFrame(frameOut); jb.ReleaseFrame(frameOut);
} }
TEST(jb.NumNotDecodablePackets() == 10); TEST(jb.num_not_decodable_packets() == 10);
// Insert 3 old packets and verify that we have 3 discarded packets // Insert 3 old packets and verify that we have 3 discarded packets
// Match value to actual latest timestamp decoded // Match value to actual latest timestamp decoded
@@ -875,12 +871,12 @@ int JitterBufferTest(CmdArgs& args)
frameIn = jb.GetFrame(packet); frameIn = jb.GetFrame(packet);
TEST(frameIn == NULL); TEST(frameIn == NULL);
TEST(jb.DiscardedPackets() == 3); TEST(jb.num_discarded_packets() == 3);
jb.Flush(); jb.Flush();
// This statistic shouldn't be reset by a flush. // This statistic shouldn't be reset by a flush.
TEST(jb.DiscardedPackets() == 3); TEST(jb.num_discarded_packets() == 3);
//printf("DONE Statistics\n"); //printf("DONE Statistics\n");
@@ -916,7 +912,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -943,7 +939,8 @@ int JitterBufferTest(CmdArgs& args)
TEST(kIncomplete == jb.InsertPacket(frameIn, packet)); TEST(kIncomplete == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(2, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(2, &incomingFrameType,
&renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -1009,7 +1006,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -1036,7 +1033,8 @@ int JitterBufferTest(CmdArgs& args)
TEST(kIncomplete == jb.InsertPacket(frameIn, packet)); TEST(kIncomplete == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(2, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(2, &incomingFrameType,
&renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -1101,7 +1099,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -1125,7 +1123,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kIncomplete == jb.InsertPacket(frameIn, packet)); TEST(kIncomplete == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -1186,7 +1184,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(3000 == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(3000 == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
TEST(kVideoFrameDelta == incomingFrameType); TEST(kVideoFrameDelta == incomingFrameType);
// Get the frame // Get the frame
@@ -1240,7 +1238,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
TEST(kVideoFrameDelta == incomingFrameType); TEST(kVideoFrameDelta == incomingFrameType);
// Get the frame // Get the frame
@@ -1291,7 +1289,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -1334,7 +1332,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// get packet notification // get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -1394,7 +1392,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// Get packet notification // Get packet notification
TEST(0xffffff00 == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(0xffffff00 == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
TEST(kVideoFrameDelta == incomingFrameType); TEST(kVideoFrameDelta == incomingFrameType);
// Insert next frame // Insert next frame
@@ -1413,7 +1411,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// Get packet notification // Get packet notification
TEST(0xffffff00 == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(0xffffff00 == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
TEST(kVideoFrameDelta == incomingFrameType); TEST(kVideoFrameDelta == incomingFrameType);
// Get frame // Get frame
@@ -1426,7 +1424,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(frameOut->FrameType() == kVideoFrameDelta); TEST(frameOut->FrameType() == kVideoFrameDelta);
// Get packet notification // Get packet notification
TEST(2700 == jb.GetNextTimeStamp(0, incomingFrameType, renderTimeMs)); TEST(2700 == jb.NextTimestamp(0, &incomingFrameType, &renderTimeMs));
TEST(kVideoFrameDelta == incomingFrameType); TEST(kVideoFrameDelta == incomingFrameType);
// Get frame // Get frame
@@ -1469,7 +1467,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// Get packet notification // Get packet notification
TEST(2700 == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(2700 == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
TEST(kVideoFrameDelta == incomingFrameType); TEST(kVideoFrameDelta == incomingFrameType);
// Insert second frame // Insert second frame
@@ -1488,7 +1486,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// Get packet notification // Get packet notification
TEST(0xffffff00 == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(0xffffff00 == jb.NextTimestamp(10, &incomingFrameType, &renderTimeMs));
TEST(kVideoFrameDelta == incomingFrameType); TEST(kVideoFrameDelta == incomingFrameType);
// Get frame // Get frame
@@ -1501,7 +1499,7 @@ int JitterBufferTest(CmdArgs& args)
TEST(frameOut->FrameType() == kVideoFrameDelta); TEST(frameOut->FrameType() == kVideoFrameDelta);
// get packet notification // get packet notification
TEST(2700 == jb.GetNextTimeStamp(0, incomingFrameType, renderTimeMs)); TEST(2700 == jb.NextTimestamp(0, &incomingFrameType, &renderTimeMs));
TEST(kVideoFrameDelta == incomingFrameType); TEST(kVideoFrameDelta == incomingFrameType);
// Get frame // Get frame
@@ -1551,7 +1549,8 @@ int JitterBufferTest(CmdArgs& args)
} }
// get packet notification // get packet notification
TEST(packet.timestamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(packet.timestamp == jb.NextTimestamp(10, &incomingFrameType,
&renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -1622,8 +1621,8 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// Get packet notification, should be first inserted frame // Get packet notification, should be first inserted frame
TEST(timeStampStart == jb.GetNextTimeStamp(10, incomingFrameType, TEST(timeStampStart == jb.NextTimestamp(10, &incomingFrameType,
renderTimeMs)); &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameDelta); TEST(incomingFrameType == kVideoFrameDelta);
@@ -1650,8 +1649,8 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// First inserted key frame should be oldest in buffer // First inserted key frame should be oldest in buffer
TEST(timeStampFirstKey == jb.GetNextTimeStamp(10, incomingFrameType, TEST(timeStampFirstKey == jb.NextTimestamp(10, &incomingFrameType,
renderTimeMs)); &renderTimeMs));
// check incoming frame type // check incoming frame type
TEST(incomingFrameType == kVideoFrameKey); TEST(incomingFrameType == kVideoFrameKey);
@@ -1764,7 +1763,8 @@ int JitterBufferTest(CmdArgs& args)
TEST(kFirstPacket == jb.InsertPacket(frameIn, packet)); TEST(kFirstPacket == jb.InsertPacket(frameIn, packet));
// Get packet notification // Get packet notification
TEST(timeStamp == jb.GetNextTimeStamp(10, incomingFrameType, renderTimeMs)); TEST(timeStamp == jb.NextTimestamp(10, &incomingFrameType,
&renderTimeMs));
frameOut = jb.GetFrameForDecoding(); frameOut = jb.GetFrameForDecoding();
// We can decode everything from a NALU until a packet has been lost. // We can decode everything from a NALU until a packet has been lost.