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

Side by Side Diff: webrtc/pc/channel.cc

Issue 1984983002: Remove use of RtpHeaderExtension and clean up (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comments Created 4 years, 7 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 * Copyright 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 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 25 matching lines...) Expand all
36 std::unique_ptr<webrtc::AudioSinkInterface>* sink) { 36 std::unique_ptr<webrtc::AudioSinkInterface>* sink) {
37 channel->SetRawAudioSink(ssrc, std::move(*sink)); 37 channel->SetRawAudioSink(ssrc, std::move(*sink));
38 return true; 38 return true;
39 } 39 }
40 40
41 struct SendPacketMessageData : public rtc::MessageData { 41 struct SendPacketMessageData : public rtc::MessageData {
42 rtc::CopyOnWriteBuffer packet; 42 rtc::CopyOnWriteBuffer packet;
43 rtc::PacketOptions options; 43 rtc::PacketOptions options;
44 }; 44 };
45 45
46 #if defined(ENABLE_EXTERNAL_AUTH)
47 // Returns the named header extension if found among all extensions,
48 // empty extension otherwise.
49 inline const webrtc::RtpExtension FindHeaderExtension(
danilchap 2016/05/18 20:00:09 why changing function signature and returning copy
danilchap 2016/05/18 20:00:09 no need for inline inside .cc
Irfan 2016/05/19 00:56:22 Done.
50 const std::vector<webrtc::RtpExtension>& extensions,
51 const std::string& uri) {
52 for (auto extension : extensions) {
danilchap 2016/05/18 20:00:09 const auto& to avoid unnecessary copy (and beeing
Irfan 2016/05/19 00:56:22 Done.
53 if (extension.uri == uri)
54 return extension;
55 }
56 return webrtc::RtpExtension();
57 }
58 #endif
59
46 } // namespace 60 } // namespace
47 61
48 enum { 62 enum {
49 MSG_EARLYMEDIATIMEOUT = 1, 63 MSG_EARLYMEDIATIMEOUT = 1,
50 MSG_SEND_RTP_PACKET, 64 MSG_SEND_RTP_PACKET,
51 MSG_SEND_RTCP_PACKET, 65 MSG_SEND_RTCP_PACKET,
52 MSG_CHANNEL_ERROR, 66 MSG_CHANNEL_ERROR,
53 MSG_READYTOSENDDATA, 67 MSG_READYTOSENDDATA,
54 MSG_DATARECEIVED, 68 MSG_DATARECEIVED,
55 MSG_FIRSTPACKETRECEIVED, 69 MSG_FIRSTPACKETRECEIVED,
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 SafeSetError(desc.str(), error_desc); 1394 SafeSetError(desc.str(), error_desc);
1381 ret = false; 1395 ret = false;
1382 } 1396 }
1383 } 1397 }
1384 } 1398 }
1385 remote_streams_ = streams; 1399 remote_streams_ = streams;
1386 return ret; 1400 return ret;
1387 } 1401 }
1388 1402
1389 void BaseChannel::MaybeCacheRtpAbsSendTimeHeaderExtension_w( 1403 void BaseChannel::MaybeCacheRtpAbsSendTimeHeaderExtension_w(
1390 const std::vector<RtpHeaderExtension>& extensions) { 1404 const std::vector<webrtc::RtpExtension>& extensions) {
1391 // Absolute Send Time extension id is used only with external auth, 1405 // Absolute Send Time extension id is used only with external auth,
1392 // so do not bother searching for it and making asyncronious call to set 1406 // so do not bother searching for it and making asyncronious call to set
1393 // something that is not used. 1407 // something that is not used.
1394 #if defined(ENABLE_EXTERNAL_AUTH) 1408 #if defined(ENABLE_EXTERNAL_AUTH)
1395 const RtpHeaderExtension* send_time_extension = 1409 const webrtc::RtpExtension send_time_extension =
1396 FindHeaderExtension(extensions, kRtpAbsoluteSenderTimeHeaderExtension); 1410 FindHeaderExtension(extensions, webrtc::RtpExtension::kAbsSendTimeUri);
1397 int rtp_abs_sendtime_extn_id = 1411 int rtp_abs_sendtime_extn_id =
1398 send_time_extension ? send_time_extension->id : -1; 1412 send_time_extension.id ? send_time_extension.id : -1;
1399 invoker_.AsyncInvoke<void>( 1413 invoker_.AsyncInvoke<void>(
1400 network_thread_, Bind(&BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n, 1414 network_thread_, Bind(&BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n,
1401 this, rtp_abs_sendtime_extn_id)); 1415 this, rtp_abs_sendtime_extn_id));
1402 #endif 1416 #endif
1403 } 1417 }
1404 1418
1405 void BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n( 1419 void BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n(
1406 int rtp_abs_sendtime_extn_id) { 1420 int rtp_abs_sendtime_extn_id) {
1407 rtp_abs_sendtime_extn_id_ = rtp_abs_sendtime_extn_id; 1421 rtp_abs_sendtime_extn_id_ = rtp_abs_sendtime_extn_id;
1408 } 1422 }
(...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after
2345 return data_channel_type_ == DCT_RTP && BaseChannel::ShouldSetupDtlsSrtp_n(); 2359 return data_channel_type_ == DCT_RTP && BaseChannel::ShouldSetupDtlsSrtp_n();
2346 } 2360 }
2347 2361
2348 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { 2362 void DataChannel::OnStreamClosedRemotely(uint32_t sid) {
2349 rtc::TypedMessageData<uint32_t>* message = 2363 rtc::TypedMessageData<uint32_t>* message =
2350 new rtc::TypedMessageData<uint32_t>(sid); 2364 new rtc::TypedMessageData<uint32_t>(sid);
2351 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); 2365 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message);
2352 } 2366 }
2353 2367
2354 } // namespace cricket 2368 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698