Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1936)

Unified Diff: webrtc/modules/video_coding/jitter_buffer_unittest.cc

Issue 2381233004: Revert of Use sps and pps to determine decodability of H.264 frames. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer.cc ('k') | webrtc/modules/video_coding/session_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/jitter_buffer_unittest.cc
diff --git a/webrtc/modules/video_coding/jitter_buffer_unittest.cc b/webrtc/modules/video_coding/jitter_buffer_unittest.cc
index 425a4e9745839a8f6f03cdb570dcb5b6222380b1..c7108c11d822ecb30e20843c804fa87db4fb5d29 100644
--- a/webrtc/modules/video_coding/jitter_buffer_unittest.cc
+++ b/webrtc/modules/video_coding/jitter_buffer_unittest.cc
@@ -12,9 +12,9 @@
#include <list>
#include <memory>
-#include <vector>
-
-#include "webrtc/common_video/h264/h264_common.h"
+
+#include "webrtc/test/gtest.h"
+#include "webrtc/test/gmock.h"
#include "webrtc/modules/video_coding/frame_buffer.h"
#include "webrtc/modules/video_coding/jitter_buffer.h"
#include "webrtc/modules/video_coding/media_opt_util.h"
@@ -26,8 +26,6 @@
#include "webrtc/system_wrappers/include/metrics.h"
#include "webrtc/system_wrappers/include/metrics_default.h"
#include "webrtc/test/field_trial.h"
-#include "webrtc/test/gmock.h"
-#include "webrtc/test/gtest.h"
namespace webrtc {
@@ -1162,89 +1160,6 @@
jitter_buffer_->ReleaseFrame(frame_out);
}
-TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) {
- jitter_buffer_->SetDecodeErrorMode(kNoErrors);
-
- packet_->timestamp = timestamp_;
- packet_->frameType = kVideoFrameKey;
- packet_->isFirstPacket = true;
- packet_->markerBit = true;
- packet_->codec = kVideoCodecH264;
- packet_->video_header.codec = kRtpVideoH264;
- packet_->video_header.codecHeader.H264.nalu_type = H264::NaluType::kIdr;
- packet_->video_header.codecHeader.H264.nalus[0].type = H264::NaluType::kIdr;
- packet_->video_header.codecHeader.H264.nalus[0].sps_id = -1;
- packet_->video_header.codecHeader.H264.nalus[0].pps_id = 0;
- packet_->video_header.codecHeader.H264.nalus_length = 1;
- bool retransmitted = false;
- EXPECT_EQ(kCompleteSession,
- jitter_buffer_->InsertPacket(*packet_, &retransmitted));
- // Not decodable since sps and pps are missing.
- EXPECT_EQ(nullptr, DecodeCompleteFrame());
-
- timestamp_ += 3000;
- packet_->timestamp = timestamp_;
- ++seq_num_;
- packet_->seqNum = seq_num_;
- packet_->frameType = kVideoFrameKey;
- packet_->isFirstPacket = true;
- packet_->markerBit = false;
- packet_->codec = kVideoCodecH264;
- packet_->video_header.codec = kRtpVideoH264;
- packet_->video_header.codecHeader.H264.nalu_type = H264::NaluType::kStapA;
- packet_->video_header.codecHeader.H264.nalus[0].type = H264::NaluType::kSps;
- packet_->video_header.codecHeader.H264.nalus[0].sps_id = 0;
- packet_->video_header.codecHeader.H264.nalus[0].pps_id = -1;
- packet_->video_header.codecHeader.H264.nalus[1].type = H264::NaluType::kPps;
- packet_->video_header.codecHeader.H264.nalus[1].sps_id = 0;
- packet_->video_header.codecHeader.H264.nalus[1].pps_id = 0;
- packet_->video_header.codecHeader.H264.nalus_length = 2;
- // Not complete since the marker bit hasn't been received.
- EXPECT_EQ(kIncomplete,
- jitter_buffer_->InsertPacket(*packet_, &retransmitted));
-
- ++seq_num_;
- packet_->seqNum = seq_num_;
- packet_->frameType = kVideoFrameKey;
- packet_->isFirstPacket = false;
- packet_->markerBit = true;
- packet_->codec = kVideoCodecH264;
- packet_->video_header.codec = kRtpVideoH264;
- packet_->video_header.codecHeader.H264.nalu_type = H264::NaluType::kIdr;
- packet_->video_header.codecHeader.H264.nalus[0].type = H264::NaluType::kIdr;
- packet_->video_header.codecHeader.H264.nalus[0].sps_id = -1;
- packet_->video_header.codecHeader.H264.nalus[0].pps_id = 0;
- packet_->video_header.codecHeader.H264.nalus_length = 1;
- // Complete and decodable since the pps and sps are received in the first
- // packet of this frame.
- EXPECT_EQ(kCompleteSession,
- jitter_buffer_->InsertPacket(*packet_, &retransmitted));
- VCMEncodedFrame* frame_out = DecodeCompleteFrame();
- ASSERT_NE(nullptr, frame_out);
- jitter_buffer_->ReleaseFrame(frame_out);
-
- timestamp_ += 3000;
- packet_->timestamp = timestamp_;
- ++seq_num_;
- packet_->seqNum = seq_num_;
- packet_->frameType = kVideoFrameDelta;
- packet_->isFirstPacket = true;
- packet_->markerBit = true;
- packet_->codec = kVideoCodecH264;
- packet_->video_header.codec = kRtpVideoH264;
- packet_->video_header.codecHeader.H264.nalu_type = H264::NaluType::kSlice;
- packet_->video_header.codecHeader.H264.nalus[0].type = H264::NaluType::kSlice;
- packet_->video_header.codecHeader.H264.nalus[0].sps_id = -1;
- packet_->video_header.codecHeader.H264.nalus[0].pps_id = 0;
- packet_->video_header.codecHeader.H264.nalus_length = 1;
- // Complete and decodable since sps, pps and key frame has been received.
- EXPECT_EQ(kCompleteSession,
- jitter_buffer_->InsertPacket(*packet_, &retransmitted));
- frame_out = DecodeCompleteFrame();
- ASSERT_NE(nullptr, frame_out);
- jitter_buffer_->ReleaseFrame(frame_out);
-}
-
// Test threshold conditions of decodable state.
TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsThresholdCheck) {
jitter_buffer_->SetDecodeErrorMode(kSelectiveErrors);
@@ -2718,4 +2633,5 @@
nack_list = jitter_buffer_->GetNackList(&extended);
EXPECT_EQ(0u, nack_list.size());
}
+
} // namespace webrtc
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer.cc ('k') | webrtc/modules/video_coding/session_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698