Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc

Issue 2316993002: Only parse PPS up to PPS and SPS ids in the depacketizater. (Closed)
Patch Set: Comment addressed. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/common_video/h264/pps_parser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 482
483 if (sps) { 483 if (sps) {
484 parsed_payload->type.Video.width = sps->width; 484 parsed_payload->type.Video.width = sps->width;
485 parsed_payload->type.Video.height = sps->height; 485 parsed_payload->type.Video.height = sps->height;
486 nalu.sps_id = sps->id; 486 nalu.sps_id = sps->id;
487 } 487 }
488 parsed_payload->frame_type = kVideoFrameKey; 488 parsed_payload->frame_type = kVideoFrameKey;
489 break; 489 break;
490 } 490 }
491 case H264::NaluType::kPps: { 491 case H264::NaluType::kPps: {
492 rtc::Optional<PpsParser::PpsState> pps = PpsParser::ParsePps( 492 uint32_t pps_id;
493 &payload_data[start_offset], end_offset - start_offset); 493 uint32_t sps_id;
494 if (pps) { 494 if (PpsParser::ParsePpsIds(&payload_data[start_offset],
495 nalu.sps_id = pps->sps_id; 495 end_offset - start_offset, &pps_id,
496 nalu.pps_id = pps->id; 496 &sps_id)) {
497 nalu.pps_id = pps_id;
498 nalu.sps_id = sps_id;
499 } else {
500 LOG(LS_WARNING)
501 << "Failed to parse PPS id and SPS id from PPS slice.";
497 } 502 }
498 break; 503 break;
499 } 504 }
500 case H264::NaluType::kSei: 505 case H264::NaluType::kSei:
501 FALLTHROUGH(); 506 FALLTHROUGH();
502 case H264::NaluType::kIdr: 507 case H264::NaluType::kIdr:
503 parsed_payload->frame_type = kVideoFrameKey; 508 parsed_payload->frame_type = kVideoFrameKey;
504 FALLTHROUGH(); 509 FALLTHROUGH();
505 default: { 510 default: {
506 rtc::Optional<uint32_t> pps_id = PpsParser::ParsePpsIdFromSlice( 511 rtc::Optional<uint32_t> pps_id = PpsParser::ParsePpsIdFromSlice(
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 parsed_payload->type.Video.isFirstPacket = first_fragment; 569 parsed_payload->type.Video.isFirstPacket = first_fragment;
565 RTPVideoHeaderH264* h264 = &parsed_payload->type.Video.codecHeader.H264; 570 RTPVideoHeaderH264* h264 = &parsed_payload->type.Video.codecHeader.H264;
566 h264->packetization_type = kH264FuA; 571 h264->packetization_type = kH264FuA;
567 h264->nalu_type = original_nal_type; 572 h264->nalu_type = original_nal_type;
568 h264->nalus[h264->nalus_length] = nalu; 573 h264->nalus[h264->nalus_length] = nalu;
569 h264->nalus_length = 1; 574 h264->nalus_length = 1;
570 return true; 575 return true;
571 } 576 }
572 577
573 } // namespace webrtc 578 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_video/h264/pps_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698