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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 bool is_first_packet) { | 58 bool is_first_packet) { |
59 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), "Video::ParseRtp", | 59 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"), "Video::ParseRtp", |
60 "seqnum", rtp_header->header.sequenceNumber, "timestamp", | 60 "seqnum", rtp_header->header.sequenceNumber, "timestamp", |
61 rtp_header->header.timestamp); | 61 rtp_header->header.timestamp); |
62 rtp_header->type.Video.codec = specific_payload.Video.videoCodecType; | 62 rtp_header->type.Video.codec = specific_payload.Video.videoCodecType; |
63 | 63 |
64 RTC_DCHECK_GE(payload_length, rtp_header->header.paddingLength); | 64 RTC_DCHECK_GE(payload_length, rtp_header->header.paddingLength); |
65 const size_t payload_data_length = | 65 const size_t payload_data_length = |
66 payload_length - rtp_header->header.paddingLength; | 66 payload_length - rtp_header->header.paddingLength; |
67 | 67 |
68 if (payload == NULL || payload_data_length == 0) { | 68 if (payload == nullptr || payload_data_length == 0) { |
69 return data_callback_->OnReceivedPayloadData(NULL, 0, rtp_header) == 0 ? 0 | 69 return data_callback_->OnReceivedPayloadData(nullptr, 0, rtp_header) == 0 |
70 : -1; | 70 ? 0 |
| 71 : -1; |
71 } | 72 } |
72 | 73 |
73 if (first_packet_received_()) { | 74 if (first_packet_received_()) { |
74 LOG(LS_INFO) << "Received first video RTP packet"; | 75 LOG(LS_INFO) << "Received first video RTP packet"; |
75 } | 76 } |
76 | 77 |
77 // We are not allowed to hold a critical section when calling below functions. | 78 // We are not allowed to hold a critical section when calling below functions. |
78 std::unique_ptr<RtpDepacketizer> depacketizer( | 79 std::unique_ptr<RtpDepacketizer> depacketizer( |
79 RtpDepacketizer::Create(rtp_header->type.Video.codec)); | 80 RtpDepacketizer::Create(rtp_header->type.Video.codec)); |
80 if (depacketizer.get() == NULL) { | 81 if (depacketizer.get() == nullptr) { |
81 LOG(LS_ERROR) << "Failed to create depacketizer."; | 82 LOG(LS_ERROR) << "Failed to create depacketizer."; |
82 return -1; | 83 return -1; |
83 } | 84 } |
84 | 85 |
85 rtp_header->type.Video.is_first_packet_in_frame = is_first_packet; | 86 rtp_header->type.Video.is_first_packet_in_frame = is_first_packet; |
86 RtpDepacketizer::ParsedPayload parsed_payload; | 87 RtpDepacketizer::ParsedPayload parsed_payload; |
87 if (!depacketizer->Parse(&parsed_payload, payload, payload_data_length)) | 88 if (!depacketizer->Parse(&parsed_payload, payload, payload_data_length)) |
88 return -1; | 89 return -1; |
89 | 90 |
90 rtp_header->frameType = parsed_payload.frame_type; | 91 rtp_header->frameType = parsed_payload.frame_type; |
(...skipping 25 matching lines...) Expand all Loading... |
116 RtpFeedback* callback, | 117 RtpFeedback* callback, |
117 int8_t payload_type, | 118 int8_t payload_type, |
118 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 119 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
119 const PayloadUnion& specific_payload) const { | 120 const PayloadUnion& specific_payload) const { |
120 // TODO(pbos): Remove as soon as audio can handle a changing payload type | 121 // TODO(pbos): Remove as soon as audio can handle a changing payload type |
121 // without this callback. | 122 // without this callback. |
122 return 0; | 123 return 0; |
123 } | 124 } |
124 | 125 |
125 } // namespace webrtc | 126 } // namespace webrtc |
OLD | NEW |