| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 if (!known_codec) { | 148 if (!known_codec) { |
| 149 LOG(LS_WARNING) << | 149 LOG(LS_WARNING) << |
| 150 "Failed to SetSendCodecs because there is no known codec."; | 150 "Failed to SetSendCodecs because there is no known codec."; |
| 151 return false; | 151 return false; |
| 152 } | 152 } |
| 153 | 153 |
| 154 send_codecs_ = codecs; | 154 send_codecs_ = codecs; |
| 155 return true; | 155 return true; |
| 156 } | 156 } |
| 157 | 157 |
| 158 bool RtpDataMediaChannel::SetSendParameters(const DataSendParameters& params) { |
| 159 return (SetSendCodecs(params.codecs) && |
| 160 SetMaxSendBandwidth(params.max_bandwidth_bps)); |
| 161 } |
| 162 |
| 163 bool RtpDataMediaChannel::SetRecvParameters(const DataRecvParameters& params) { |
| 164 return SetRecvCodecs(params.codecs); |
| 165 } |
| 166 |
| 158 bool RtpDataMediaChannel::AddSendStream(const StreamParams& stream) { | 167 bool RtpDataMediaChannel::AddSendStream(const StreamParams& stream) { |
| 159 if (!stream.has_ssrcs()) { | 168 if (!stream.has_ssrcs()) { |
| 160 return false; | 169 return false; |
| 161 } | 170 } |
| 162 | 171 |
| 163 if (GetStreamBySsrc(send_streams_, stream.first_ssrc())) { | 172 if (GetStreamBySsrc(send_streams_, stream.first_ssrc())) { |
| 164 LOG(LS_WARNING) << "Not adding data send stream '" << stream.id | 173 LOG(LS_WARNING) << "Not adding data send stream '" << stream.id |
| 165 << "' with ssrc=" << stream.first_ssrc() | 174 << "' with ssrc=" << stream.first_ssrc() |
| 166 << " because stream already exists."; | 175 << " because stream already exists."; |
| 167 return false; | 176 return false; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 362 |
| 354 MediaChannel::SendPacket(&packet); | 363 MediaChannel::SendPacket(&packet); |
| 355 send_limiter_->Use(packet_len, now); | 364 send_limiter_->Use(packet_len, now); |
| 356 if (result) { | 365 if (result) { |
| 357 *result = SDR_SUCCESS; | 366 *result = SDR_SUCCESS; |
| 358 } | 367 } |
| 359 return true; | 368 return true; |
| 360 } | 369 } |
| 361 | 370 |
| 362 } // namespace cricket | 371 } // namespace cricket |
| OLD | NEW |