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

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

Issue 1327933002: Full impl of NnChannel::SetSendParameters and NnChannel::SetRecvParameters (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Got rid of SetChannelOptions Created 5 years, 3 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 2014 Google Inc. 3 * Copyright 2014 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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 const VideoOptions& options, 604 const VideoOptions& options,
605 VoiceMediaChannel* voice_channel) { 605 VoiceMediaChannel* voice_channel) {
606 DCHECK(initialized_); 606 DCHECK(initialized_);
607 LOG(LS_INFO) << "CreateChannel: " 607 LOG(LS_INFO) << "CreateChannel: "
608 << (voice_channel != NULL ? "With" : "Without") 608 << (voice_channel != NULL ? "With" : "Without")
609 << " voice channel. Options: " << options.ToString(); 609 << " voice channel. Options: " << options.ToString();
610 WebRtcVideoChannel2* channel = 610 WebRtcVideoChannel2* channel =
611 new WebRtcVideoChannel2(call_factory_, voice_engine_, 611 new WebRtcVideoChannel2(call_factory_, voice_engine_,
612 static_cast<WebRtcVoiceMediaChannel*>(voice_channel), options, 612 static_cast<WebRtcVoiceMediaChannel*>(voice_channel), options,
613 external_encoder_factory_, external_decoder_factory_); 613 external_encoder_factory_, external_decoder_factory_);
614 if (!channel->Init()) { 614 if (!channel->Init(video_codecs_)) {
615 delete channel; 615 delete channel;
616 return NULL; 616 return NULL;
617 } 617 }
618 channel->SetRecvCodecs(video_codecs_);
619 return channel; 618 return channel;
620 } 619 }
621 620
622 const std::vector<VideoCodec>& WebRtcVideoEngine2::codecs() const { 621 const std::vector<VideoCodec>& WebRtcVideoEngine2::codecs() const {
623 return video_codecs_; 622 return video_codecs_;
624 } 623 }
625 624
626 const std::vector<RtpHeaderExtension>& 625 const std::vector<RtpHeaderExtension>&
627 WebRtcVideoEngine2::rtp_header_extensions() const { 626 WebRtcVideoEngine2::rtp_header_extensions() const {
628 return rtp_header_extensions_; 627 return rtp_header_extensions_;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 } 813 }
815 814
816 WebRtcVideoChannel2::~WebRtcVideoChannel2() { 815 WebRtcVideoChannel2::~WebRtcVideoChannel2() {
817 DetachVoiceChannel(); 816 DetachVoiceChannel();
818 for (auto& kv : send_streams_) 817 for (auto& kv : send_streams_)
819 delete kv.second; 818 delete kv.second;
820 for (auto& kv : receive_streams_) 819 for (auto& kv : receive_streams_)
821 delete kv.second; 820 delete kv.second;
822 } 821 }
823 822
824 bool WebRtcVideoChannel2::Init() { return true; } 823 bool WebRtcVideoChannel2::Init(const std::vector<VideoCodec>& recv_codecs) {
824 SetRecvCodecs(recv_codecs);
825 return true;
826 }
825 827
826 void WebRtcVideoChannel2::DetachVoiceChannel() { 828 void WebRtcVideoChannel2::DetachVoiceChannel() {
827 DCHECK(thread_checker_.CalledOnValidThread()); 829 DCHECK(thread_checker_.CalledOnValidThread());
828 if (voice_channel_) { 830 if (voice_channel_) {
829 voice_channel_->SetCall(nullptr); 831 voice_channel_->SetCall(nullptr);
830 voice_channel_ = nullptr; 832 voice_channel_ = nullptr;
831 } 833 }
832 } 834 }
833 835
834 bool WebRtcVideoChannel2::CodecIsExternallySupported( 836 bool WebRtcVideoChannel2::CodecIsExternallySupported(
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 webrtc::PacketReceiver::DELIVERY_OK) { 1495 webrtc::PacketReceiver::DELIVERY_OK) {
1494 LOG(LS_WARNING) << "Failed to deliver RTCP packet."; 1496 LOG(LS_WARNING) << "Failed to deliver RTCP packet.";
1495 } 1497 }
1496 } 1498 }
1497 1499
1498 void WebRtcVideoChannel2::OnReadyToSend(bool ready) { 1500 void WebRtcVideoChannel2::OnReadyToSend(bool ready) {
1499 LOG(LS_VERBOSE) << "OnReadyToSend: " << (ready ? "Ready." : "Not ready."); 1501 LOG(LS_VERBOSE) << "OnReadyToSend: " << (ready ? "Ready." : "Not ready.");
1500 call_->SignalNetworkState(ready ? webrtc::kNetworkUp : webrtc::kNetworkDown); 1502 call_->SignalNetworkState(ready ? webrtc::kNetworkUp : webrtc::kNetworkDown);
1501 } 1503 }
1502 1504
1503 bool WebRtcVideoChannel2::MuteStream(uint32 ssrc, bool mute) { 1505 bool WebRtcVideoChannel2::MuteStream(uint32 ssrc, bool mute,
1506 const VideoOptions* options) {
1504 LOG(LS_VERBOSE) << "MuteStream: " << ssrc << " -> " 1507 LOG(LS_VERBOSE) << "MuteStream: " << ssrc << " -> "
1505 << (mute ? "mute" : "unmute"); 1508 << (mute ? "mute" : "unmute");
1506 DCHECK(ssrc != 0); 1509 DCHECK(ssrc != 0);
1507 rtc::CritScope stream_lock(&stream_crit_); 1510 rtc::CritScope stream_lock(&stream_crit_);
1508 if (send_streams_.find(ssrc) == send_streams_.end()) { 1511 if (send_streams_.find(ssrc) == send_streams_.end()) {
1509 LOG(LS_ERROR) << "No sending stream on ssrc " << ssrc; 1512 LOG(LS_ERROR) << "No sending stream on ssrc " << ssrc;
1510 return false; 1513 return false;
1511 } 1514 }
1512 1515
1513 send_streams_[ssrc]->MuteStream(mute); 1516 send_streams_[ssrc]->MuteStream(mute);
1514 return true; 1517
1518 if (!mute && options) {
1519 return SetOptions(*options);
1520 } else {
1521 return true;
1522 }
1515 } 1523 }
1516 1524
1517 bool WebRtcVideoChannel2::SetRecvRtpHeaderExtensions( 1525 bool WebRtcVideoChannel2::SetRecvRtpHeaderExtensions(
1518 const std::vector<RtpHeaderExtension>& extensions) { 1526 const std::vector<RtpHeaderExtension>& extensions) {
1519 TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::SetRecvRtpHeaderExtensions"); 1527 TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::SetRecvRtpHeaderExtensions");
1520 LOG(LS_INFO) << "SetRecvRtpHeaderExtensions: " 1528 LOG(LS_INFO) << "SetRecvRtpHeaderExtensions: "
1521 << RtpExtensionsToString(extensions); 1529 << RtpExtensionsToString(extensions);
1522 if (!ValidateRtpHeaderExtensionIds(extensions)) 1530 if (!ValidateRtpHeaderExtensionIds(extensions))
1523 return false; 1531 return false;
1524 1532
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
2749 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2757 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2750 } 2758 }
2751 } 2759 }
2752 2760
2753 return video_codecs; 2761 return video_codecs;
2754 } 2762 }
2755 2763
2756 } // namespace cricket 2764 } // namespace cricket
2757 2765
2758 #endif // HAVE_WEBRTC_VIDEO 2766 #endif // HAVE_WEBRTC_VIDEO
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698