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

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 nit Created 4 years, 6 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 // nullptr otherwise.
49 const webrtc::RtpExtension* FindHeaderExtension(
50 const std::vector<webrtc::RtpExtension>& extensions,
51 const std::string& uri) {
52 for (const auto& extension : extensions) {
53 if (extension.uri == uri)
54 return &extension;
55 }
56 return nullptr;
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 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 SafeSetError(desc.str(), error_desc); 1397 SafeSetError(desc.str(), error_desc);
1384 ret = false; 1398 ret = false;
1385 } 1399 }
1386 } 1400 }
1387 } 1401 }
1388 remote_streams_ = streams; 1402 remote_streams_ = streams;
1389 return ret; 1403 return ret;
1390 } 1404 }
1391 1405
1392 void BaseChannel::MaybeCacheRtpAbsSendTimeHeaderExtension_w( 1406 void BaseChannel::MaybeCacheRtpAbsSendTimeHeaderExtension_w(
1393 const std::vector<RtpHeaderExtension>& extensions) { 1407 const std::vector<webrtc::RtpExtension>& extensions) {
1394 // Absolute Send Time extension id is used only with external auth, 1408 // Absolute Send Time extension id is used only with external auth,
1395 // so do not bother searching for it and making asyncronious call to set 1409 // so do not bother searching for it and making asyncronious call to set
1396 // something that is not used. 1410 // something that is not used.
1397 #if defined(ENABLE_EXTERNAL_AUTH) 1411 #if defined(ENABLE_EXTERNAL_AUTH)
1398 const RtpHeaderExtension* send_time_extension = 1412 const webrtc::RtpExtension* send_time_extension =
1399 FindHeaderExtension(extensions, kRtpAbsoluteSenderTimeHeaderExtension); 1413 FindHeaderExtension(extensions, webrtc::RtpExtension::kAbsSendTimeUri);
1400 int rtp_abs_sendtime_extn_id = 1414 int rtp_abs_sendtime_extn_id =
1401 send_time_extension ? send_time_extension->id : -1; 1415 send_time_extension ? send_time_extension->id : -1;
1402 invoker_.AsyncInvoke<void>( 1416 invoker_.AsyncInvoke<void>(
1403 network_thread_, Bind(&BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n, 1417 network_thread_, Bind(&BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n,
1404 this, rtp_abs_sendtime_extn_id)); 1418 this, rtp_abs_sendtime_extn_id));
1405 #endif 1419 #endif
1406 } 1420 }
1407 1421
1408 void BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n( 1422 void BaseChannel::CacheRtpAbsSendTimeHeaderExtension_n(
1409 int rtp_abs_sendtime_extn_id) { 1423 int rtp_abs_sendtime_extn_id) {
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after
2398 return data_channel_type_ == DCT_RTP && BaseChannel::ShouldSetupDtlsSrtp_n(); 2412 return data_channel_type_ == DCT_RTP && BaseChannel::ShouldSetupDtlsSrtp_n();
2399 } 2413 }
2400 2414
2401 void DataChannel::OnStreamClosedRemotely(uint32_t sid) { 2415 void DataChannel::OnStreamClosedRemotely(uint32_t sid) {
2402 rtc::TypedMessageData<uint32_t>* message = 2416 rtc::TypedMessageData<uint32_t>* message =
2403 new rtc::TypedMessageData<uint32_t>(sid); 2417 new rtc::TypedMessageData<uint32_t>(sid);
2404 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message); 2418 signaling_thread()->Post(this, MSG_STREAMCLOSEDREMOTELY, message);
2405 } 2419 }
2406 2420
2407 } // namespace cricket 2421 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/pc/channel.h ('k') | webrtc/pc/mediasession.h » ('j') | webrtc/pc/mediasession.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698