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 22 matching lines...) Expand all Loading... |
33 // buffer for it, otherwise SRTP will fail later. If SRTP ever uses | 33 // buffer for it, otherwise SRTP will fail later. If SRTP ever uses |
34 // more than this, we need to increase this number. | 34 // more than this, we need to increase this number. |
35 static const size_t kMaxSrtpHmacOverhead = 16; | 35 static const size_t kMaxSrtpHmacOverhead = 16; |
36 | 36 |
37 RtpDataEngine::RtpDataEngine() { | 37 RtpDataEngine::RtpDataEngine() { |
38 data_codecs_.push_back( | 38 data_codecs_.push_back( |
39 DataCodec(kGoogleRtpDataCodecPlType, kGoogleRtpDataCodecName)); | 39 DataCodec(kGoogleRtpDataCodecPlType, kGoogleRtpDataCodecName)); |
40 } | 40 } |
41 | 41 |
42 DataMediaChannel* RtpDataEngine::CreateChannel( | 42 DataMediaChannel* RtpDataEngine::CreateChannel( |
43 DataChannelType data_channel_type) { | 43 DataChannelType data_channel_type, |
| 44 const MediaConfig& config) { |
44 if (data_channel_type != DCT_RTP) { | 45 if (data_channel_type != DCT_RTP) { |
45 return NULL; | 46 return NULL; |
46 } | 47 } |
47 return new RtpDataMediaChannel(); | 48 return new RtpDataMediaChannel(config); |
48 } | 49 } |
49 | 50 |
50 static const DataCodec* FindCodecByName(const std::vector<DataCodec>& codecs, | 51 static const DataCodec* FindCodecByName(const std::vector<DataCodec>& codecs, |
51 const std::string& name) { | 52 const std::string& name) { |
52 for (const DataCodec& codec : codecs) { | 53 for (const DataCodec& codec : codecs) { |
53 if (_stricmp(name.c_str(), codec.name.c_str()) == 0) | 54 if (_stricmp(name.c_str(), codec.name.c_str()) == 0) |
54 return &codec; | 55 return &codec; |
55 } | 56 } |
56 return nullptr; | 57 return nullptr; |
57 } | 58 } |
58 | 59 |
59 RtpDataMediaChannel::RtpDataMediaChannel() { | 60 RtpDataMediaChannel::RtpDataMediaChannel(const MediaConfig& config) |
| 61 : DataMediaChannel(config) { |
60 Construct(); | 62 Construct(); |
61 } | 63 } |
62 | 64 |
63 void RtpDataMediaChannel::Construct() { | 65 void RtpDataMediaChannel::Construct() { |
64 sending_ = false; | 66 sending_ = false; |
65 receiving_ = false; | 67 receiving_ = false; |
66 send_limiter_.reset(new rtc::RateLimiter(kDataMaxBandwidth / 8, 1.0)); | 68 send_limiter_.reset(new rtc::RateLimiter(kDataMaxBandwidth / 8, 1.0)); |
67 } | 69 } |
68 | 70 |
69 | 71 |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 << ", len=" << payload.size(); | 336 << ", len=" << payload.size(); |
335 | 337 |
336 MediaChannel::SendPacket(&packet, rtc::PacketOptions()); | 338 MediaChannel::SendPacket(&packet, rtc::PacketOptions()); |
337 send_limiter_->Use(packet_len, now); | 339 send_limiter_->Use(packet_len, now); |
338 if (result) { | 340 if (result) { |
339 *result = SDR_SUCCESS; | 341 *result = SDR_SUCCESS; |
340 } | 342 } |
341 return true; | 343 return true; |
342 } | 344 } |
343 | 345 |
| 346 rtc::DiffServCodePoint RtpDataMediaChannel::PreferredDscp() const { |
| 347 return rtc::DSCP_AF41; |
| 348 } |
| 349 |
344 } // namespace cricket | 350 } // namespace cricket |
OLD | NEW |