| 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..6b9908b271a0502273c8aca7210a0789177555f3 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;
|
| + }
|
| +}
|
|
|
| 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_EQ(packetization_mode_, kH264PacketizationMode1);
|
| 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_EQ(packetization_mode_, kH264PacketizationMode1);
|
| NextAggregatePacket(buffer, bytes_to_send);
|
| RTC_CHECK_LE(*bytes_to_send, max_payload_len_);
|
| } else {
|
| + RTC_CHECK_EQ(packetization_mode_, kH264PacketizationMode1);
|
| NextFragmentPacket(buffer, bytes_to_send);
|
| RTC_CHECK_LE(*bytes_to_send, max_payload_len_);
|
| }
|
|
|