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...) 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 nalu.offset = start_offset; | |
stefan-webrtc
2016/11/02 13:54:17
Should we set these for FuA too, or make clear the
philipel
2016/11/02 14:39:43
Done.
| |
415 nalu.size = end_offset - start_offset; | |
414 nalu.sps_id = -1; | 416 nalu.sps_id = -1; |
415 nalu.pps_id = -1; | 417 nalu.pps_id = -1; |
416 start_offset += H264::kNaluTypeSize; | 418 start_offset += H264::kNaluTypeSize; |
417 | 419 |
418 switch (nalu.type) { | 420 switch (nalu.type) { |
419 case H264::NaluType::kSps: { | 421 case H264::NaluType::kSps: { |
420 // Check if VUI is present in SPS and if it needs to be modified to | 422 // Check if VUI is present in SPS and if it needs to be modified to |
421 // avoid | 423 // avoid |
422 // excessive decoder latency. | 424 // excessive decoder latency. |
423 | 425 |
(...skipping 169 matching lines...) Loading... | |
593 h264->packetization_type = kH264FuA; | 595 h264->packetization_type = kH264FuA; |
594 h264->nalu_type = original_nal_type; | 596 h264->nalu_type = original_nal_type; |
595 if (first_fragment) { | 597 if (first_fragment) { |
596 h264->nalus[h264->nalus_length] = nalu; | 598 h264->nalus[h264->nalus_length] = nalu; |
597 h264->nalus_length = 1; | 599 h264->nalus_length = 1; |
598 } | 600 } |
599 return true; | 601 return true; |
600 } | 602 } |
601 | 603 |
602 } // namespace webrtc | 604 } // namespace webrtc |
OLD | NEW |