OLD | NEW |
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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 while (!last) { | 259 while (!last) { |
260 uint8_t dataBuffer[IP_PACKET_SIZE] = {0}; | 260 uint8_t dataBuffer[IP_PACKET_SIZE] = {0}; |
261 size_t payload_bytes_in_packet = 0; | 261 size_t payload_bytes_in_packet = 0; |
262 | 262 |
263 if (!packetizer->NextPacket(&dataBuffer[rtp_header_length], | 263 if (!packetizer->NextPacket(&dataBuffer[rtp_header_length], |
264 &payload_bytes_in_packet, &last)) { | 264 &payload_bytes_in_packet, &last)) { |
265 return -1; | 265 return -1; |
266 } | 266 } |
267 | 267 |
268 // Write RTP header. | 268 // Write RTP header. |
269 rtp_sender_->BuildRtpHeader(dataBuffer, payload_type, last, | 269 int32_t header_length = rtp_sender_->BuildRtpHeader( |
270 capture_timestamp, capture_time_ms); | 270 dataBuffer, payload_type, last, capture_timestamp, capture_time_ms); |
| 271 if (header_length <= 0) |
| 272 return -1; |
271 | 273 |
272 // According to | 274 // According to |
273 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ | 275 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ |
274 // ts_126114v120700p.pdf Section 7.4.5: | 276 // ts_126114v120700p.pdf Section 7.4.5: |
275 // The MTSI client shall add the payload bytes as defined in this clause | 277 // The MTSI client shall add the payload bytes as defined in this clause |
276 // onto the last RTP packet in each group of packets which make up a key | 278 // onto the last RTP packet in each group of packets which make up a key |
277 // frame (I-frame or IDR frame in H.264 (AVC), or an IRAP picture in H.265 | 279 // frame (I-frame or IDR frame in H.264 (AVC), or an IRAP picture in H.265 |
278 // (HEVC)). The MTSI client may also add the payload bytes onto the last RTP | 280 // (HEVC)). The MTSI client may also add the payload bytes onto the last RTP |
279 // packet in each group of packets which make up another type of frame | 281 // packet in each group of packets which make up another type of frame |
280 // (e.g. a P-Frame) only if the current value is different from the previous | 282 // (e.g. a P-Frame) only if the current value is different from the previous |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 rtc::CritScope cs(&crit_); | 341 rtc::CritScope cs(&crit_); |
340 return retransmission_settings_; | 342 return retransmission_settings_; |
341 } | 343 } |
342 | 344 |
343 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { | 345 void RTPSenderVideo::SetSelectiveRetransmissions(uint8_t settings) { |
344 rtc::CritScope cs(&crit_); | 346 rtc::CritScope cs(&crit_); |
345 retransmission_settings_ = settings; | 347 retransmission_settings_ = settings; |
346 } | 348 } |
347 | 349 |
348 } // namespace webrtc | 350 } // namespace webrtc |
OLD | NEW |