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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // End offset is actually start offset for next unit, excluding length field | 404 // End offset is actually start offset for next unit, excluding length field |
405 // so remove that from this units length. | 405 // so remove that from this units length. |
406 size_t end_offset = nalu_start_offsets[i + 1] - kLengthFieldSize; | 406 size_t end_offset = nalu_start_offsets[i + 1] - kLengthFieldSize; |
407 if (end_offset - start_offset < H264::kNaluTypeSize) { | 407 if (end_offset - start_offset < H264::kNaluTypeSize) { |
408 LOG(LS_ERROR) << "STAP-A packet too short"; | 408 LOG(LS_ERROR) << "STAP-A packet too short"; |
409 return false; | 409 return false; |
410 } | 410 } |
411 | 411 |
412 NaluInfo nalu; | 412 NaluInfo nalu; |
413 nalu.type = payload_data[start_offset] & kTypeMask; | 413 nalu.type = payload_data[start_offset] & kTypeMask; |
| 414 if (nalu.type != H264::NaluType::kFuA) { |
| 415 nalu.offset = start_offset; |
| 416 nalu.size = end_offset - start_offset; |
| 417 } |
414 nalu.sps_id = -1; | 418 nalu.sps_id = -1; |
415 nalu.pps_id = -1; | 419 nalu.pps_id = -1; |
416 start_offset += H264::kNaluTypeSize; | 420 start_offset += H264::kNaluTypeSize; |
417 | 421 |
418 switch (nalu.type) { | 422 switch (nalu.type) { |
419 case H264::NaluType::kSps: { | 423 case H264::NaluType::kSps: { |
420 // Check if VUI is present in SPS and if it needs to be modified to | 424 // Check if VUI is present in SPS and if it needs to be modified to |
421 // avoid | 425 // avoid |
422 // excessive decoder latency. | 426 // excessive decoder latency. |
423 | 427 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 h264->packetization_type = kH264FuA; | 597 h264->packetization_type = kH264FuA; |
594 h264->nalu_type = original_nal_type; | 598 h264->nalu_type = original_nal_type; |
595 if (first_fragment) { | 599 if (first_fragment) { |
596 h264->nalus[h264->nalus_length] = nalu; | 600 h264->nalus[h264->nalus_length] = nalu; |
597 h264->nalus_length = 1; | 601 h264->nalus_length = 1; |
598 } | 602 } |
599 return true; | 603 return true; |
600 } | 604 } |
601 | 605 |
602 } // namespace webrtc | 606 } // namespace webrtc |
OLD | NEW |