OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 <memory> |
| 12 |
11 #include "webrtc/base/checks.h" | 13 #include "webrtc/base/checks.h" |
12 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 14 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
13 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" | 15 #include "webrtc/modules/rtp_rtcp/source/byte_io.h" |
14 #include "webrtc/modules/rtp_rtcp/source/rtp_format.h" | 16 #include "webrtc/modules/rtp_rtcp/source/rtp_format.h" |
15 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 17 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
16 #include "webrtc/test/layer_filtering_transport.h" | 18 #include "webrtc/test/layer_filtering_transport.h" |
17 | 19 |
18 namespace webrtc { | 20 namespace webrtc { |
19 namespace test { | 21 namespace test { |
20 | 22 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 57 |
56 if (header.payloadType == vp8_video_payload_type_ || | 58 if (header.payloadType == vp8_video_payload_type_ || |
57 header.payloadType == vp9_video_payload_type_) { | 59 header.payloadType == vp9_video_payload_type_) { |
58 const uint8_t* payload = packet + header.headerLength; | 60 const uint8_t* payload = packet + header.headerLength; |
59 RTC_DCHECK_GT(length, header.headerLength); | 61 RTC_DCHECK_GT(length, header.headerLength); |
60 const size_t payload_length = length - header.headerLength; | 62 const size_t payload_length = length - header.headerLength; |
61 RTC_DCHECK_GT(payload_length, header.paddingLength); | 63 RTC_DCHECK_GT(payload_length, header.paddingLength); |
62 const size_t payload_data_length = payload_length - header.paddingLength; | 64 const size_t payload_data_length = payload_length - header.paddingLength; |
63 | 65 |
64 const bool is_vp8 = header.payloadType == vp8_video_payload_type_; | 66 const bool is_vp8 = header.payloadType == vp8_video_payload_type_; |
65 rtc::scoped_ptr<RtpDepacketizer> depacketizer( | 67 std::unique_ptr<RtpDepacketizer> depacketizer( |
66 RtpDepacketizer::Create(is_vp8 ? kRtpVideoVp8 : kRtpVideoVp9)); | 68 RtpDepacketizer::Create(is_vp8 ? kRtpVideoVp8 : kRtpVideoVp9)); |
67 RtpDepacketizer::ParsedPayload parsed_payload; | 69 RtpDepacketizer::ParsedPayload parsed_payload; |
68 if (depacketizer->Parse(&parsed_payload, payload, payload_data_length)) { | 70 if (depacketizer->Parse(&parsed_payload, payload, payload_data_length)) { |
69 const int temporal_idx = static_cast<int>( | 71 const int temporal_idx = static_cast<int>( |
70 is_vp8 ? parsed_payload.type.Video.codecHeader.VP8.temporalIdx | 72 is_vp8 ? parsed_payload.type.Video.codecHeader.VP8.temporalIdx |
71 : parsed_payload.type.Video.codecHeader.VP9.temporal_idx); | 73 : parsed_payload.type.Video.codecHeader.VP9.temporal_idx); |
72 const int spatial_idx = static_cast<int>( | 74 const int spatial_idx = static_cast<int>( |
73 is_vp8 ? kNoSpatialIdx | 75 is_vp8 ? kNoSpatialIdx |
74 : parsed_payload.type.Video.codecHeader.VP9.spatial_idx); | 76 : parsed_payload.type.Video.codecHeader.VP9.spatial_idx); |
75 if (selected_sl_ >= 0 && spatial_idx == selected_sl_ && | 77 if (selected_sl_ >= 0 && spatial_idx == selected_sl_ && |
(...skipping 20 matching lines...) Expand all Loading... |
96 // make sure the marker bit is set properly, and that sequence numbers are | 98 // make sure the marker bit is set properly, and that sequence numbers are |
97 // continuous. | 99 // continuous. |
98 if (set_marker_bit) | 100 if (set_marker_bit) |
99 temp_buffer[1] |= kRtpMarkerBitMask; | 101 temp_buffer[1] |= kRtpMarkerBitMask; |
100 | 102 |
101 return test::DirectTransport::SendRtp(temp_buffer, length, options); | 103 return test::DirectTransport::SendRtp(temp_buffer, length, options); |
102 } | 104 } |
103 | 105 |
104 } // namespace test | 106 } // namespace test |
105 } // namespace webrtc | 107 } // namespace webrtc |
OLD | NEW |