Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: talk/media/webrtc/webrtcvoiceengine.cc

Issue 1229283003: Refactor the relationship between BaseChannel and MediaChannel so that we send over all the paramet… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: SetRtpTransportParameters_w Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 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 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1737 // Remove any remaining streams. 1737 // Remove any remaining streams.
1738 while (!receive_channels_.empty()) { 1738 while (!receive_channels_.empty()) {
1739 RemoveRecvStream(receive_channels_.begin()->first); 1739 RemoveRecvStream(receive_channels_.begin()->first);
1740 } 1740 }
1741 DCHECK(receive_streams_.empty()); 1741 DCHECK(receive_streams_.empty());
1742 1742
1743 // Delete the default channel. 1743 // Delete the default channel.
1744 DeleteChannel(voe_channel()); 1744 DeleteChannel(voe_channel());
1745 } 1745 }
1746 1746
1747 bool WebRtcVoiceMediaChannel::SetSendParameters(
1748 const AudioSendParameters& params) {
1749 // TODO(pthatcher): Refactor this to be more clean now that we have
1750 // all the information at once.
1751 return (SetSendCodecs(params.codecs) &&
1752 SetSendRtpHeaderExtensions(params.extensions) &&
1753 SetMaxSendBandwidth(params.max_bandwidth_bps) &&
1754 SetOptions(params.options));
1755 }
1756
1757 bool WebRtcVoiceMediaChannel::SetRecvParameters(
1758 const AudioRecvParameters& params) {
1759 // TODO(pthatcher): Refactor this to be more clean now that we have
1760 // all the information at once.
1761 return (SetRecvCodecs(params.codecs) &&
1762 SetRecvRtpHeaderExtensions(params.extensions));
1763 }
1764
1747 bool WebRtcVoiceMediaChannel::SetOptions(const AudioOptions& options) { 1765 bool WebRtcVoiceMediaChannel::SetOptions(const AudioOptions& options) {
1748 LOG(LS_INFO) << "Setting voice channel options: " 1766 LOG(LS_INFO) << "Setting voice channel options: "
1749 << options.ToString(); 1767 << options.ToString();
1750 1768
1751 // Check if DSCP value is changed from previous. 1769 // Check if DSCP value is changed from previous.
1752 bool dscp_option_changed = (options_.dscp != options.dscp); 1770 bool dscp_option_changed = (options_.dscp != options.dscp);
1753 1771
1754 // TODO(xians): Add support to set different options for different send 1772 // TODO(xians): Add support to set different options for different send
1755 // streams after we support multiple APMs. 1773 // streams after we support multiple APMs.
1756 1774
(...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after
3655 3673
3656 int WebRtcSoundclipStream::Rewind() { 3674 int WebRtcSoundclipStream::Rewind() {
3657 mem_.Rewind(); 3675 mem_.Rewind();
3658 // Return -1 to keep VoiceEngine from looping. 3676 // Return -1 to keep VoiceEngine from looping.
3659 return (loop_) ? 0 : -1; 3677 return (loop_) ? 0 : -1;
3660 } 3678 }
3661 3679
3662 } // namespace cricket 3680 } // namespace cricket
3663 3681
3664 #endif // HAVE_WEBRTC_VOICE 3682 #endif // HAVE_WEBRTC_VOICE
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698