| 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 |
| 11 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_video.h" | 11 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_video.h" |
| 12 | 12 |
| 13 #include <assert.h> | 13 #include <assert.h> |
| 14 #include <string.h> | 14 #include <string.h> |
| 15 | 15 |
| 16 #include <memory> |
| 17 |
| 16 #include "webrtc/base/checks.h" | 18 #include "webrtc/base/checks.h" |
| 17 #include "webrtc/base/logging.h" | 19 #include "webrtc/base/logging.h" |
| 18 #include "webrtc/base/trace_event.h" | 20 #include "webrtc/base/trace_event.h" |
| 19 #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" | 21 #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" |
| 20 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" | 22 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h" |
| 21 #include "webrtc/modules/rtp_rtcp/source/rtp_format.h" | 23 #include "webrtc/modules/rtp_rtcp/source/rtp_format.h" |
| 22 #include "webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h" | 24 #include "webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h" |
| 23 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
| 24 | 26 |
| 25 namespace webrtc { | 27 namespace webrtc { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 if (payload == NULL || payload_data_length == 0) { | 69 if (payload == NULL || payload_data_length == 0) { |
| 68 return data_callback_->OnReceivedPayloadData(NULL, 0, rtp_header) == 0 ? 0 | 70 return data_callback_->OnReceivedPayloadData(NULL, 0, rtp_header) == 0 ? 0 |
| 69 : -1; | 71 : -1; |
| 70 } | 72 } |
| 71 | 73 |
| 72 if (first_packet_received_()) { | 74 if (first_packet_received_()) { |
| 73 LOG(LS_INFO) << "Received first video RTP packet"; | 75 LOG(LS_INFO) << "Received first video RTP packet"; |
| 74 } | 76 } |
| 75 | 77 |
| 76 // 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. |
| 77 rtc::scoped_ptr<RtpDepacketizer> depacketizer( | 79 std::unique_ptr<RtpDepacketizer> depacketizer( |
| 78 RtpDepacketizer::Create(rtp_header->type.Video.codec)); | 80 RtpDepacketizer::Create(rtp_header->type.Video.codec)); |
| 79 if (depacketizer.get() == NULL) { | 81 if (depacketizer.get() == NULL) { |
| 80 LOG(LS_ERROR) << "Failed to create depacketizer."; | 82 LOG(LS_ERROR) << "Failed to create depacketizer."; |
| 81 return -1; | 83 return -1; |
| 82 } | 84 } |
| 83 | 85 |
| 84 rtp_header->type.Video.isFirstPacket = is_first_packet; | 86 rtp_header->type.Video.isFirstPacket = is_first_packet; |
| 85 RtpDepacketizer::ParsedPayload parsed_payload; | 87 RtpDepacketizer::ParsedPayload parsed_payload; |
| 86 if (!depacketizer->Parse(&parsed_payload, payload, payload_data_length)) | 88 if (!depacketizer->Parse(&parsed_payload, payload, payload_data_length)) |
| 87 return -1; | 89 return -1; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 116 RtpFeedback* callback, | 118 RtpFeedback* callback, |
| 117 int8_t payload_type, | 119 int8_t payload_type, |
| 118 const char payload_name[RTP_PAYLOAD_NAME_SIZE], | 120 const char payload_name[RTP_PAYLOAD_NAME_SIZE], |
| 119 const PayloadUnion& specific_payload) const { | 121 const PayloadUnion& specific_payload) const { |
| 120 // TODO(pbos): Remove as soon as audio can handle a changing payload type | 122 // TODO(pbos): Remove as soon as audio can handle a changing payload type |
| 121 // without this callback. | 123 // without this callback. |
| 122 return 0; | 124 return 0; |
| 123 } | 125 } |
| 124 | 126 |
| 125 } // namespace webrtc | 127 } // namespace webrtc |
| OLD | NEW |