| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } | 56 } |
| 57 return true; | 57 return true; |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool ParseSingleNalu(RtpDepacketizer::ParsedPayload* parsed_payload, | 60 bool ParseSingleNalu(RtpDepacketizer::ParsedPayload* parsed_payload, |
| 61 const uint8_t* payload_data, | 61 const uint8_t* payload_data, |
| 62 size_t payload_data_length) { | 62 size_t payload_data_length) { |
| 63 parsed_payload->type.Video.width = 0; | 63 parsed_payload->type.Video.width = 0; |
| 64 parsed_payload->type.Video.height = 0; | 64 parsed_payload->type.Video.height = 0; |
| 65 parsed_payload->type.Video.codec = kRtpVideoH264; | 65 parsed_payload->type.Video.codec = kRtpVideoH264; |
| 66 parsed_payload->type.Video.simulcastIdx = 0; |
| 66 parsed_payload->type.Video.isFirstPacket = true; | 67 parsed_payload->type.Video.isFirstPacket = true; |
| 67 RTPVideoHeaderH264* h264_header = | 68 RTPVideoHeaderH264* h264_header = |
| 68 &parsed_payload->type.Video.codecHeader.H264; | 69 &parsed_payload->type.Video.codecHeader.H264; |
| 69 | 70 |
| 70 const uint8_t* nalu_start = payload_data + kNalHeaderSize; | 71 const uint8_t* nalu_start = payload_data + kNalHeaderSize; |
| 71 size_t nalu_length = payload_data_length - kNalHeaderSize; | 72 size_t nalu_length = payload_data_length - kNalHeaderSize; |
| 72 uint8_t nal_type = payload_data[0] & kTypeMask; | 73 uint8_t nal_type = payload_data[0] & kTypeMask; |
| 73 if (nal_type == kStapA) { | 74 if (nal_type == kStapA) { |
| 74 // Skip the StapA header (StapA nal type + length). | 75 // Skip the StapA header (StapA nal type + length). |
| 75 if (payload_data_length <= kStapAHeaderSize) { | 76 if (payload_data_length <= kStapAHeaderSize) { |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 // will depacketize the STAP-A into NAL units later. | 367 // will depacketize the STAP-A into NAL units later. |
| 367 if (!ParseSingleNalu(parsed_payload, payload_data, payload_data_length)) | 368 if (!ParseSingleNalu(parsed_payload, payload_data, payload_data_length)) |
| 368 return false; | 369 return false; |
| 369 } | 370 } |
| 370 | 371 |
| 371 parsed_payload->payload = payload_data + offset; | 372 parsed_payload->payload = payload_data + offset; |
| 372 parsed_payload->payload_length = payload_data_length - offset; | 373 parsed_payload->payload_length = payload_data_length - offset; |
| 373 return true; | 374 return true; |
| 374 } | 375 } |
| 375 } // namespace webrtc | 376 } // namespace webrtc |
| OLD | NEW |