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

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

Issue 2692993009: Allow default video receive channel to receive on any unsignalled SSRC, (Closed)
Patch Set: Defensive code: Zero SSRC after removing default stream. Created 3 years, 10 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
« no previous file with comments | « AUTHORS ('k') | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 } 421 }
422 return nullptr; 422 return nullptr;
423 } 423 }
424 424
425 DefaultUnsignalledSsrcHandler::DefaultUnsignalledSsrcHandler() 425 DefaultUnsignalledSsrcHandler::DefaultUnsignalledSsrcHandler()
426 : default_recv_ssrc_(0), default_sink_(NULL) {} 426 : default_recv_ssrc_(0), default_sink_(NULL) {}
427 427
428 UnsignalledSsrcHandler::Action DefaultUnsignalledSsrcHandler::OnUnsignalledSsrc( 428 UnsignalledSsrcHandler::Action DefaultUnsignalledSsrcHandler::OnUnsignalledSsrc(
429 WebRtcVideoChannel2* channel, 429 WebRtcVideoChannel2* channel,
430 uint32_t ssrc) { 430 uint32_t ssrc) {
431 if (default_recv_ssrc_ != 0) { // Already one default stream. 431 if (default_recv_ssrc_ != 0) { // Already one default stream, so replace it.
432 LOG(LS_WARNING) << "Unknown SSRC, but default receive stream already set."; 432 channel->RemoveRecvStream(default_recv_ssrc_);
433 return kDropPacket; 433 default_recv_ssrc_ = 0;
434 } 434 }
435 435
436 StreamParams sp; 436 StreamParams sp;
437 sp.ssrcs.push_back(ssrc); 437 sp.ssrcs.push_back(ssrc);
438 LOG(LS_INFO) << "Creating default receive stream for SSRC=" << ssrc << "."; 438 LOG(LS_INFO) << "Creating default receive stream for SSRC=" << ssrc << ".";
439 if (!channel->AddRecvStream(sp, true)) { 439 if (!channel->AddRecvStream(sp, true)) {
440 LOG(LS_WARNING) << "Could not create default receive stream."; 440 LOG(LS_WARNING) << "Could not create default receive stream.";
441 } 441 }
442 442
443 channel->SetSink(ssrc, default_sink_); 443 channel->SetSink(ssrc, default_sink_);
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 rtx_mapping[video_codecs[i].codec.id] != 2527 rtx_mapping[video_codecs[i].codec.id] !=
2528 ulpfec_config.red_payload_type) { 2528 ulpfec_config.red_payload_type) {
2529 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2529 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2530 } 2530 }
2531 } 2531 }
2532 2532
2533 return video_codecs; 2533 return video_codecs;
2534 } 2534 }
2535 2535
2536 } // namespace cricket 2536 } // namespace cricket
OLDNEW
« no previous file with comments | « AUTHORS ('k') | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698