Insert startcodes for H264 single NALU packets.
Bug: none Change-Id: I68ee9b84d75b67044d28a47fe740c79a2cd33517 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/142169 Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28287}
This commit is contained in:
@ -140,8 +140,10 @@ H264SpsPpsTracker::PacketAction H264SpsPpsTracker::CopyAndFixBitstream(
|
||||
nalu_ptr += segment_length;
|
||||
}
|
||||
} else {
|
||||
if (video_header.is_first_packet_in_frame)
|
||||
if (video_header.is_first_packet_in_frame ||
|
||||
h264_header.packetization_type == kH264SingleNalu) {
|
||||
required_size += sizeof(start_code_h264);
|
||||
}
|
||||
required_size += data_size;
|
||||
}
|
||||
|
||||
@ -202,7 +204,8 @@ H264SpsPpsTracker::PacketAction H264SpsPpsTracker::CopyAndFixBitstream(
|
||||
nalu_ptr += segment_length;
|
||||
}
|
||||
} else {
|
||||
if (video_header.is_first_packet_in_frame) {
|
||||
if (video_header.is_first_packet_in_frame ||
|
||||
h264_header.packetization_type == kH264SingleNalu) {
|
||||
memcpy(insert_at, start_code_h264, sizeof(start_code_h264));
|
||||
insert_at += sizeof(start_code_h264);
|
||||
}
|
||||
|
@ -149,10 +149,9 @@ TEST_F(TestH264SpsPpsTracker, StapAIncorrectSegmentLength) {
|
||||
EXPECT_EQ(H264SpsPpsTracker::kDrop, tracker_.CopyAndFixBitstream(&packet));
|
||||
}
|
||||
|
||||
TEST_F(TestH264SpsPpsTracker, NoNalusFirstPacket) {
|
||||
TEST_F(TestH264SpsPpsTracker, SingleNaluInsertStartCode) {
|
||||
uint8_t data[] = {1, 2, 3};
|
||||
H264VcmPacket packet;
|
||||
packet.video_header.is_first_packet_in_frame = true;
|
||||
packet.dataPtr = data;
|
||||
packet.sizeBytes = sizeof(data);
|
||||
|
||||
|
Reference in New Issue
Block a user