| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 parsed_payload->payload_length = length_; | 382 parsed_payload->payload_length = length_; |
| 383 return true; | 383 return true; |
| 384 } | 384 } |
| 385 | 385 |
| 386 bool RtpDepacketizerH264::ProcessStapAOrSingleNalu( | 386 bool RtpDepacketizerH264::ProcessStapAOrSingleNalu( |
| 387 ParsedPayload* parsed_payload, | 387 ParsedPayload* parsed_payload, |
| 388 const uint8_t* payload_data) { | 388 const uint8_t* payload_data) { |
| 389 parsed_payload->type.Video.width = 0; | 389 parsed_payload->type.Video.width = 0; |
| 390 parsed_payload->type.Video.height = 0; | 390 parsed_payload->type.Video.height = 0; |
| 391 parsed_payload->type.Video.codec = kRtpVideoH264; | 391 parsed_payload->type.Video.codec = kRtpVideoH264; |
| 392 parsed_payload->type.Video.isFirstPacket = true; | 392 parsed_payload->type.Video.is_first_packet_in_frame = true; |
| 393 RTPVideoHeaderH264* h264_header = | 393 RTPVideoHeaderH264* h264_header = |
| 394 &parsed_payload->type.Video.codecHeader.H264; | 394 &parsed_payload->type.Video.codecHeader.H264; |
| 395 | 395 |
| 396 const uint8_t* nalu_start = payload_data + kNalHeaderSize; | 396 const uint8_t* nalu_start = payload_data + kNalHeaderSize; |
| 397 const size_t nalu_length = length_ - kNalHeaderSize; | 397 const size_t nalu_length = length_ - kNalHeaderSize; |
| 398 uint8_t nal_type = payload_data[0] & kTypeMask; | 398 uint8_t nal_type = payload_data[0] & kTypeMask; |
| 399 std::vector<size_t> nalu_start_offsets; | 399 std::vector<size_t> nalu_start_offsets; |
| 400 if (nal_type == H264::NaluType::kStapA) { | 400 if (nal_type == H264::NaluType::kStapA) { |
| 401 // Skip the StapA header (StapA NAL type + length). | 401 // Skip the StapA header (StapA NAL type + length). |
| 402 if (length_ <= kStapAHeaderSize) { | 402 if (length_ <= kStapAHeaderSize) { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 } | 603 } |
| 604 | 604 |
| 605 if (original_nal_type == H264::NaluType::kIdr) { | 605 if (original_nal_type == H264::NaluType::kIdr) { |
| 606 parsed_payload->frame_type = kVideoFrameKey; | 606 parsed_payload->frame_type = kVideoFrameKey; |
| 607 } else { | 607 } else { |
| 608 parsed_payload->frame_type = kVideoFrameDelta; | 608 parsed_payload->frame_type = kVideoFrameDelta; |
| 609 } | 609 } |
| 610 parsed_payload->type.Video.width = 0; | 610 parsed_payload->type.Video.width = 0; |
| 611 parsed_payload->type.Video.height = 0; | 611 parsed_payload->type.Video.height = 0; |
| 612 parsed_payload->type.Video.codec = kRtpVideoH264; | 612 parsed_payload->type.Video.codec = kRtpVideoH264; |
| 613 parsed_payload->type.Video.isFirstPacket = first_fragment; | 613 parsed_payload->type.Video.is_first_packet_in_frame = first_fragment; |
| 614 RTPVideoHeaderH264* h264 = &parsed_payload->type.Video.codecHeader.H264; | 614 RTPVideoHeaderH264* h264 = &parsed_payload->type.Video.codecHeader.H264; |
| 615 h264->packetization_type = kH264FuA; | 615 h264->packetization_type = kH264FuA; |
| 616 h264->nalu_type = original_nal_type; | 616 h264->nalu_type = original_nal_type; |
| 617 if (first_fragment) { | 617 if (first_fragment) { |
| 618 h264->nalus[h264->nalus_length] = nalu; | 618 h264->nalus[h264->nalus_length] = nalu; |
| 619 h264->nalus_length = 1; | 619 h264->nalus_length = 1; |
| 620 } | 620 } |
| 621 return true; | 621 return true; |
| 622 } | 622 } |
| 623 | 623 |
| 624 } // namespace webrtc | 624 } // namespace webrtc |
| OLD | NEW |