| 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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 // End offset is actually start offset for next unit, excluding length field | 481 // End offset is actually start offset for next unit, excluding length field |
| 482 // so remove that from this units length. | 482 // so remove that from this units length. |
| 483 size_t end_offset = nalu_start_offsets[i + 1] - kLengthFieldSize; | 483 size_t end_offset = nalu_start_offsets[i + 1] - kLengthFieldSize; |
| 484 if (end_offset - start_offset < H264::kNaluTypeSize) { | 484 if (end_offset - start_offset < H264::kNaluTypeSize) { |
| 485 LOG(LS_ERROR) << "STAP-A packet too short"; | 485 LOG(LS_ERROR) << "STAP-A packet too short"; |
| 486 return false; | 486 return false; |
| 487 } | 487 } |
| 488 | 488 |
| 489 NaluInfo nalu; | 489 NaluInfo nalu; |
| 490 nalu.type = payload_data[start_offset] & kTypeMask; | 490 nalu.type = payload_data[start_offset] & kTypeMask; |
| 491 nalu.offset = start_offset; | |
| 492 nalu.size = end_offset - start_offset; | |
| 493 nalu.sps_id = -1; | 491 nalu.sps_id = -1; |
| 494 nalu.pps_id = -1; | 492 nalu.pps_id = -1; |
| 495 start_offset += H264::kNaluTypeSize; | 493 start_offset += H264::kNaluTypeSize; |
| 496 | 494 |
| 497 switch (nalu.type) { | 495 switch (nalu.type) { |
| 498 case H264::NaluType::kSps: { | 496 case H264::NaluType::kSps: { |
| 499 // Check if VUI is present in SPS and if it needs to be modified to | 497 // Check if VUI is present in SPS and if it needs to be modified to |
| 500 // avoid | 498 // avoid |
| 501 // excessive decoder latency. | 499 // excessive decoder latency. |
| 502 | 500 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 h264->packetization_type = kH264FuA; | 668 h264->packetization_type = kH264FuA; |
| 671 h264->nalu_type = original_nal_type; | 669 h264->nalu_type = original_nal_type; |
| 672 if (first_fragment) { | 670 if (first_fragment) { |
| 673 h264->nalus[h264->nalus_length] = nalu; | 671 h264->nalus[h264->nalus_length] = nalu; |
| 674 h264->nalus_length = 1; | 672 h264->nalus_length = 1; |
| 675 } | 673 } |
| 676 return true; | 674 return true; |
| 677 } | 675 } |
| 678 | 676 |
| 679 } // namespace webrtc | 677 } // namespace webrtc |
| OLD | NEW |