| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2  *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 
| 3  * | 3  * | 
| 4  *  Use of this source code is governed by a BSD-style license | 4  *  Use of this source code is governed by a BSD-style license | 
| 5  *  that can be found in the LICENSE file in the root of the source | 5  *  that can be found in the LICENSE file in the root of the source | 
| 6  *  tree. An additional intellectual property rights grant can be found | 6  *  tree. An additional intellectual property rights grant can be found | 
| 7  *  in the file PATENTS.  All contributing project authors may | 7  *  in the file PATENTS.  All contributing project authors may | 
| 8  *  be found in the AUTHORS file in the root of the source tree. | 8  *  be found in the AUTHORS file in the root of the source tree. | 
| 9  */ | 9  */ | 
| 10 | 10 | 
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 174   dec_state.SetState(&frame); | 174   dec_state.SetState(&frame); | 
| 175   EXPECT_EQ(dec_state.sequence_num(), 1); | 175   EXPECT_EQ(dec_state.sequence_num(), 1); | 
| 176   // Insert an empty packet that does not belong to the same frame. | 176   // Insert an empty packet that does not belong to the same frame. | 
| 177   // => Sequence num should be the same. | 177   // => Sequence num should be the same. | 
| 178   packet.timestamp = 2; | 178   packet.timestamp = 2; | 
| 179   dec_state.UpdateOldPacket(&packet); | 179   dec_state.UpdateOldPacket(&packet); | 
| 180   EXPECT_EQ(dec_state.sequence_num(), 1); | 180   EXPECT_EQ(dec_state.sequence_num(), 1); | 
| 181   // Now insert empty packet belonging to the same frame. | 181   // Now insert empty packet belonging to the same frame. | 
| 182   packet.timestamp = 1; | 182   packet.timestamp = 1; | 
| 183   packet.seqNum = 2; | 183   packet.seqNum = 2; | 
| 184   packet.frameType = kFrameEmpty; | 184   packet.frameType = kEmptyFrame; | 
| 185   packet.sizeBytes = 0; | 185   packet.sizeBytes = 0; | 
| 186   dec_state.UpdateOldPacket(&packet); | 186   dec_state.UpdateOldPacket(&packet); | 
| 187   EXPECT_EQ(dec_state.sequence_num(), 2); | 187   EXPECT_EQ(dec_state.sequence_num(), 2); | 
| 188   // Now insert delta packet belonging to the same frame. | 188   // Now insert delta packet belonging to the same frame. | 
| 189   packet.timestamp = 1; | 189   packet.timestamp = 1; | 
| 190   packet.seqNum = 3; | 190   packet.seqNum = 3; | 
| 191   packet.frameType = kVideoFrameDelta; | 191   packet.frameType = kVideoFrameDelta; | 
| 192   packet.sizeBytes = 1400; | 192   packet.sizeBytes = 1400; | 
| 193   dec_state.UpdateOldPacket(&packet); | 193   dec_state.UpdateOldPacket(&packet); | 
| 194   EXPECT_EQ(dec_state.sequence_num(), 3); | 194   EXPECT_EQ(dec_state.sequence_num(), 3); | 
| 195   // Insert a packet belonging to an older timestamp - should not update the | 195   // Insert a packet belonging to an older timestamp - should not update the | 
| 196   // sequence number. | 196   // sequence number. | 
| 197   packet.timestamp = 0; | 197   packet.timestamp = 0; | 
| 198   packet.seqNum = 4; | 198   packet.seqNum = 4; | 
| 199   packet.frameType = kFrameEmpty; | 199   packet.frameType = kEmptyFrame; | 
| 200   packet.sizeBytes = 0; | 200   packet.sizeBytes = 0; | 
| 201   dec_state.UpdateOldPacket(&packet); | 201   dec_state.UpdateOldPacket(&packet); | 
| 202   EXPECT_EQ(dec_state.sequence_num(), 3); | 202   EXPECT_EQ(dec_state.sequence_num(), 3); | 
| 203 } | 203 } | 
| 204 | 204 | 
| 205 TEST(TestDecodingState, MultiLayerBehavior) { | 205 TEST(TestDecodingState, MultiLayerBehavior) { | 
| 206   // Identify sync/non-sync when more than one layer. | 206   // Identify sync/non-sync when more than one layer. | 
| 207   VCMDecodingState dec_state; | 207   VCMDecodingState dec_state; | 
| 208   // Identify packets belonging to old frames/packets. | 208   // Identify packets belonging to old frames/packets. | 
| 209   // Set state for current frames. | 209   // Set state for current frames. | 
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 440   frame.Reset(); | 440   frame.Reset(); | 
| 441   // Testing only gap in tl0PicIdx when tl0PicIdx in continuous. | 441   // Testing only gap in tl0PicIdx when tl0PicIdx in continuous. | 
| 442   packet.codecSpecificHeader.codecHeader.VP8.tl0PicIdx += 3; | 442   packet.codecSpecificHeader.codecHeader.VP8.tl0PicIdx += 3; | 
| 443   packet.codecSpecificHeader.codecHeader.VP8.temporalIdx++; | 443   packet.codecSpecificHeader.codecHeader.VP8.temporalIdx++; | 
| 444   packet.codecSpecificHeader.codecHeader.VP8.tl0PicIdx = 1; | 444   packet.codecSpecificHeader.codecHeader.VP8.tl0PicIdx = 1; | 
| 445   EXPECT_LE(0, frame.InsertPacket(packet, 0, kNoErrors, frame_data)); | 445   EXPECT_LE(0, frame.InsertPacket(packet, 0, kNoErrors, frame_data)); | 
| 446   EXPECT_FALSE(dec_state.ContinuousFrame(&frame)); | 446   EXPECT_FALSE(dec_state.ContinuousFrame(&frame)); | 
| 447 } | 447 } | 
| 448 | 448 | 
| 449 }  // namespace webrtc | 449 }  // namespace webrtc | 
| OLD | NEW | 
|---|