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

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

Issue 2466993003: H264SpsPpsTracker class which keep tracks of SPS/PPS. (Closed)
Patch Set: Free copied data Created 4 years, 1 month 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/modules/include/module_common_types.h ('k') | webrtc/modules/video_coding/BUILD.gn » ('j') | 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
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;
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...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « webrtc/modules/include/module_common_types.h ('k') | webrtc/modules/video_coding/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698