Chromium Code Reviews

Side by Side Diff: webrtc/modules/video_coding/codecs/h264/include/h264_globals.h

Issue 2945853002: Only append SPS/PPS to bitstream if supplied out of bound. (Closed)
Patch Set: delete[] sps/pps data in unittests Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 39 matching lines...)
50 stream << "SingleNalUnit"; 50 stream << "SingleNalUnit";
51 break; 51 break;
52 } 52 }
53 return stream; 53 return stream;
54 } 54 }
55 55
56 struct NaluInfo { 56 struct NaluInfo {
57 uint8_t type; 57 uint8_t type;
58 int sps_id; 58 int sps_id;
59 int pps_id; 59 int pps_id;
60
61 // Offset and size are only valid for non-FuA packets.
62 size_t offset;
63 size_t size;
64 }; 60 };
65 61
66 const size_t kMaxNalusPerPacket = 10; 62 const size_t kMaxNalusPerPacket = 10;
67 63
68 struct RTPVideoHeaderH264 { 64 struct RTPVideoHeaderH264 {
69 // The NAL unit type. If this is a header for a 65 // The NAL unit type. If this is a header for a
70 // fragmented packet, it's the NAL unit type of 66 // fragmented packet, it's the NAL unit type of
71 // the original data. If this is the header for an 67 // the original data. If this is the header for an
72 // aggregated packet, it's the NAL unit type of 68 // aggregated packet, it's the NAL unit type of
73 // the first NAL unit in the packet. 69 // the first NAL unit in the packet.
74 uint8_t nalu_type; 70 uint8_t nalu_type;
75 // The packetization type of this buffer - single, aggregated or fragmented. 71 // The packetization type of this buffer - single, aggregated or fragmented.
76 H264PacketizationTypes packetization_type; 72 H264PacketizationTypes packetization_type;
77 NaluInfo nalus[kMaxNalusPerPacket]; 73 NaluInfo nalus[kMaxNalusPerPacket];
78 size_t nalus_length; 74 size_t nalus_length;
79 // The packetization mode of this transport. Packetization mode 75 // The packetization mode of this transport. Packetization mode
80 // determines which packetization types are allowed when packetizing. 76 // determines which packetization types are allowed when packetizing.
81 H264PacketizationMode packetization_mode; 77 H264PacketizationMode packetization_mode;
82 }; 78 };
83 79
84 } // namespace webrtc 80 } // namespace webrtc
85 81
86 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_INCLUDE_H264_GLOBALS_H_ 82 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_INCLUDE_H264_GLOBALS_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc ('k') | webrtc/modules/video_coding/h264_sps_pps_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine