| 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 17 matching lines...) Expand all Loading... |
| 28 0x00, 0x00, 0x00, 0x00 | 28 0x00, 0x00, 0x00, 0x00 |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 // Amount of overhead SRTP may take. We need to leave room in the | 31 // Amount of overhead SRTP may take. We need to leave room in the |
| 32 // buffer for it, otherwise SRTP will fail later. If SRTP ever uses | 32 // buffer for it, otherwise SRTP will fail later. If SRTP ever uses |
| 33 // more than this, we need to increase this number. | 33 // more than this, we need to increase this number. |
| 34 static const size_t kMaxSrtpHmacOverhead = 16; | 34 static const size_t kMaxSrtpHmacOverhead = 16; |
| 35 | 35 |
| 36 RtpDataEngine::RtpDataEngine() { | 36 RtpDataEngine::RtpDataEngine() { |
| 37 data_codecs_.push_back( | 37 data_codecs_.push_back( |
| 38 DataCodec(kGoogleRtpDataCodecId, kGoogleRtpDataCodecName)); | 38 DataCodec(kGoogleRtpDataCodecPlType, kGoogleRtpDataCodecName)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 DataMediaChannel* RtpDataEngine::CreateChannel( | 41 DataMediaChannel* RtpDataEngine::CreateChannel( |
| 42 DataChannelType data_channel_type) { | 42 DataChannelType data_channel_type) { |
| 43 if (data_channel_type != DCT_RTP) { | 43 if (data_channel_type != DCT_RTP) { |
| 44 return NULL; | 44 return NULL; |
| 45 } | 45 } |
| 46 return new RtpDataMediaChannel(); | 46 return new RtpDataMediaChannel(); |
| 47 } | 47 } |
| 48 | 48 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 77 delete iter->second; | 77 delete iter->second; |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 void RtpClock::Tick(double now, int* seq_num, uint32_t* timestamp) { | 81 void RtpClock::Tick(double now, int* seq_num, uint32_t* timestamp) { |
| 82 *seq_num = ++last_seq_num_; | 82 *seq_num = ++last_seq_num_; |
| 83 *timestamp = timestamp_offset_ + static_cast<uint32_t>(now * clockrate_); | 83 *timestamp = timestamp_offset_ + static_cast<uint32_t>(now * clockrate_); |
| 84 } | 84 } |
| 85 | 85 |
| 86 const DataCodec* FindUnknownCodec(const std::vector<DataCodec>& codecs) { | 86 const DataCodec* FindUnknownCodec(const std::vector<DataCodec>& codecs) { |
| 87 DataCodec data_codec(kGoogleRtpDataCodecId, kGoogleRtpDataCodecName); | 87 DataCodec data_codec(kGoogleRtpDataCodecPlType, kGoogleRtpDataCodecName); |
| 88 std::vector<DataCodec>::const_iterator iter; | 88 std::vector<DataCodec>::const_iterator iter; |
| 89 for (iter = codecs.begin(); iter != codecs.end(); ++iter) { | 89 for (iter = codecs.begin(); iter != codecs.end(); ++iter) { |
| 90 if (!iter->Matches(data_codec)) { | 90 if (!iter->Matches(data_codec)) { |
| 91 return &(*iter); | 91 return &(*iter); |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 return NULL; | 94 return NULL; |
| 95 } | 95 } |
| 96 | 96 |
| 97 const DataCodec* FindKnownCodec(const std::vector<DataCodec>& codecs) { | 97 const DataCodec* FindKnownCodec(const std::vector<DataCodec>& codecs) { |
| 98 DataCodec data_codec(kGoogleRtpDataCodecId, kGoogleRtpDataCodecName); | 98 DataCodec data_codec(kGoogleRtpDataCodecPlType, kGoogleRtpDataCodecName); |
| 99 std::vector<DataCodec>::const_iterator iter; | 99 std::vector<DataCodec>::const_iterator iter; |
| 100 for (iter = codecs.begin(); iter != codecs.end(); ++iter) { | 100 for (iter = codecs.begin(); iter != codecs.end(); ++iter) { |
| 101 if (iter->Matches(data_codec)) { | 101 if (iter->Matches(data_codec)) { |
| 102 return &(*iter); | 102 return &(*iter); |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 return NULL; | 105 return NULL; |
| 106 } | 106 } |
| 107 | 107 |
| 108 bool RtpDataMediaChannel::SetRecvCodecs(const std::vector<DataCodec>& codecs) { | 108 bool RtpDataMediaChannel::SetRecvCodecs(const std::vector<DataCodec>& codecs) { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 337 |
| 338 MediaChannel::SendPacket(&packet, rtc::PacketOptions()); | 338 MediaChannel::SendPacket(&packet, rtc::PacketOptions()); |
| 339 send_limiter_->Use(packet_len, now); | 339 send_limiter_->Use(packet_len, now); |
| 340 if (result) { | 340 if (result) { |
| 341 *result = SDR_SUCCESS; | 341 *result = SDR_SUCCESS; |
| 342 } | 342 } |
| 343 return true; | 343 return true; |
| 344 } | 344 } |
| 345 | 345 |
| 346 } // namespace cricket | 346 } // namespace cricket |
| OLD | NEW |