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 27479458315de126fa3e551128a748b618a81714..a9c43bf66af35572470ec5014a89869effaadc1e 100644 |
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc |
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc |
@@ -11,6 +11,7 @@ |
#include "webrtc/modules/rtp_rtcp/source/rtp_format_h264.h" |
#include <string.h> |
+ |
#include <memory> |
#include <utility> |
#include <vector> |
@@ -77,9 +78,16 @@ bool ParseStapAStartOffsets(const uint8_t* nalu_ptr, |
} // namespace |
-RtpPacketizerH264::RtpPacketizerH264(FrameType frame_type, |
+RtpPacketizerH264::RtpPacketizerH264(const RTPVideoHeaderH264& parameters, |
size_t max_payload_len) |
- : max_payload_len_(max_payload_len) {} |
+ : packetization_mode_(parameters.packetization_mode), |
+ max_payload_len_(max_payload_len) { |
+ if (packetization_mode_ == kH264PacketizationModeNotSet) { |
+ LOG(LS_WARNING) |
+ << "Creating H.264 RTP packetizer with default packetization mode"; |
+ packetization_mode_ = kH264PacketizationMode1; |
hbos
2016/10/31 10:32:26
From https://tools.ietf.org/html/rfc6184#section-6
hta-webrtc
2016/10/31 15:03:04
I started out with a RTC_CHECK here instead of the
hbos
2016/10/31 16:27:15
Acknowledged.
|
+ } |
+} |
RtpPacketizerH264::~RtpPacketizerH264() { |
} |
@@ -163,6 +171,7 @@ void RtpPacketizerH264::SetPayloadData( |
void RtpPacketizerH264::GeneratePackets() { |
for (size_t i = 0; i < input_fragments_.size();) { |
if (input_fragments_[i].length > max_payload_len_) { |
+ RTC_CHECK(packetization_mode_ == kH264PacketizationMode1); |
hbos
2016/10/31 10:32:26
nit: Here and other places in this file: RTC_CHECK
hta-webrtc
2016/10/31 15:03:04
Acknowledged.
|
PacketizeFuA(i); |
++i; |
} else { |
@@ -249,9 +258,11 @@ bool RtpPacketizerH264::NextPacket(uint8_t* buffer, |
input_fragments_.pop_front(); |
RTC_CHECK_LE(*bytes_to_send, max_payload_len_); |
} else if (packet.aggregated) { |
+ RTC_CHECK(packetization_mode_ == kH264PacketizationMode1); |
magjed_webrtc
2016/10/31 13:00:50
nit: use RTC_CHECK_EQ
|
NextAggregatePacket(buffer, bytes_to_send); |
RTC_CHECK_LE(*bytes_to_send, max_payload_len_); |
} else { |
+ RTC_CHECK(packetization_mode_ == kH264PacketizationMode1); |
NextFragmentPacket(buffer, bytes_to_send); |
RTC_CHECK_LE(*bytes_to_send, max_payload_len_); |
} |