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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc

Issue 2558453002: Revert of H.264 packetization mode 0 (try 3) (Closed)
Patch Set: Created 4 years 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
Index: webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc
index 9d71803f3b984887825d079e7a9897cd24ce2702..b82b66f5fe5a0e270a94b83041aaa18bc8150da8 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc
@@ -78,10 +78,9 @@
} // namespace
-RtpPacketizerH264::RtpPacketizerH264(size_t max_payload_len,
- H264PacketizationMode packetization_mode)
- : max_payload_len_(max_payload_len),
- packetization_mode_(packetization_mode) {}
+RtpPacketizerH264::RtpPacketizerH264(FrameType frame_type,
+ size_t max_payload_len)
+ : max_payload_len_(max_payload_len) {}
RtpPacketizerH264::~RtpPacketizerH264() {
}
@@ -164,19 +163,11 @@
void RtpPacketizerH264::GeneratePackets() {
for (size_t i = 0; i < input_fragments_.size();) {
- switch (packetization_mode_) {
- case H264PacketizationMode::SingleNalUnit:
- PacketizeSingleNalu(i);
- ++i;
- break;
- case H264PacketizationMode::NonInterleaved:
- if (input_fragments_[i].length > max_payload_len_) {
- PacketizeFuA(i);
- ++i;
- } else {
- i = PacketizeStapA(i);
- }
- break;
+ if (input_fragments_[i].length > max_payload_len_) {
+ PacketizeFuA(i);
+ ++i;
+ } else {
+ i = PacketizeStapA(i);
}
}
}
@@ -239,21 +230,6 @@
return fragment_index;
}
-void RtpPacketizerH264::PacketizeSingleNalu(size_t fragment_index) {
- // Add a single NALU to the queue, no aggregation.
- size_t payload_size_left = max_payload_len_;
- const Fragment* fragment = &input_fragments_[fragment_index];
- RTC_CHECK_GE(payload_size_left, fragment->length)
- << "Payload size left " << payload_size_left << ", fragment length "
- << fragment->length << ", packetization mode "
- << (packetization_mode_ == H264PacketizationMode::SingleNalUnit
- ? "SingleNalUnit"
- : "NonInterleaved");
- RTC_CHECK_GT(fragment->length, 0u);
- packets_.push(PacketUnit(*fragment, true /* first */, true /* last */,
- false /* aggregated */, fragment->buffer[0]));
-}
-
bool RtpPacketizerH264::NextPacket(RtpPacketToSend* rtp_packet,
bool* last_packet) {
RTC_DCHECK(rtp_packet);
@@ -272,10 +248,8 @@
packets_.pop();
input_fragments_.pop_front();
} else if (packet.aggregated) {
- RTC_CHECK(packetization_mode_ == H264PacketizationMode::NonInterleaved);
NextAggregatePacket(rtp_packet);
} else {
- RTC_CHECK(packetization_mode_ == H264PacketizationMode::NonInterleaved);
NextFragmentPacket(rtp_packet);
}
RTC_DCHECK_LE(rtp_packet->payload_size(), max_payload_len_);
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_format_h264.h ('k') | webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698