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

Unified Diff: talk/session/media/channel.cc

Issue 1363573002: Wire up transport sequence number / send time callbacks to webrtc via libjingle. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: More ios deps Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: talk/session/media/channel.cc
diff --git a/talk/session/media/channel.cc b/talk/session/media/channel.cc
index 57d09a2d6fda80311addd7f0c26bee76223c55a9..ac24ce03bd038514c7b1b1e8e1fcc3f96afb6926 100644
--- a/talk/session/media/channel.cc
+++ b/talk/session/media/channel.cc
@@ -37,6 +37,8 @@
#include "webrtc/base/common.h"
#include "webrtc/base/dscp.h"
#include "webrtc/base/logging.h"
+#include "webrtc/call.h"
+#include "webrtc/common_types.h"
namespace cricket {
@@ -67,7 +69,7 @@ static void SafeSetError(const std::string& message, std::string* error_desc) {
struct PacketMessageData : public rtc::MessageData {
rtc::Buffer packet;
- rtc::DiffServCodePoint dscp;
+ rtc::PacketOptions options;
};
struct ScreencastEventMessageData : public rtc::MessageData {
@@ -423,13 +425,13 @@ bool BaseChannel::IsReadyToSend() const {
}
bool BaseChannel::SendPacket(rtc::Buffer* packet,
- rtc::DiffServCodePoint dscp) {
- return SendPacket(false, packet, dscp);
+ const rtc::PacketOptions& options) {
+ return SendPacket(false, packet, options);
}
bool BaseChannel::SendRtcp(rtc::Buffer* packet,
- rtc::DiffServCodePoint dscp) {
- return SendPacket(true, packet, dscp);
+ const rtc::PacketOptions& options) {
+ return SendPacket(true, packet, options);
}
int BaseChannel::SetOption(SocketType type, rtc::Socket::Option opt,
@@ -498,8 +500,9 @@ bool BaseChannel::PacketIsRtcp(const TransportChannel* channel,
rtcp_mux_filter_.DemuxRtcp(data, static_cast<int>(len)));
}
-bool BaseChannel::SendPacket(bool rtcp, rtc::Buffer* packet,
- rtc::DiffServCodePoint dscp) {
+bool BaseChannel::SendPacket(bool rtcp,
+ rtc::Buffer* packet,
+ const rtc::PacketOptions& options) {
// SendPacket gets called from MediaEngine, typically on an encoder thread.
// If the thread is not our worker thread, we will post to our worker
// so that the real work happens on our worker. This avoids us having to
@@ -512,7 +515,7 @@ bool BaseChannel::SendPacket(bool rtcp, rtc::Buffer* packet,
int message_id = (!rtcp) ? MSG_RTPPACKET : MSG_RTCPPACKET;
PacketMessageData* data = new PacketMessageData;
data->packet = packet->Pass();
- data->dscp = dscp;
+ data->options = options;
worker_thread_->Post(this, message_id, data);
return true;
}
@@ -535,7 +538,8 @@ bool BaseChannel::SendPacket(bool rtcp, rtc::Buffer* packet,
return false;
}
- rtc::PacketOptions options(dscp);
+ rtc::PacketOptions updated_options;
+ updated_options = options;
// Protect if needed.
if (srtp_filter_.IsActive()) {
bool res;
@@ -551,21 +555,22 @@ bool BaseChannel::SendPacket(bool rtcp, rtc::Buffer* packet,
res = srtp_filter_.ProtectRtp(
data, len, static_cast<int>(packet->capacity()), &len);
#else
- options.packet_time_params.rtp_sendtime_extension_id =
+ updated_options.packet_time_params.rtp_sendtime_extension_id =
rtp_abs_sendtime_extn_id_;
res = srtp_filter_.ProtectRtp(
data, len, static_cast<int>(packet->capacity()), &len,
- &options.packet_time_params.srtp_packet_index);
+ &updated_options.packet_time_params.srtp_packet_index);
// If protection succeeds, let's get auth params from srtp.
if (res) {
uint8_t* auth_key = NULL;
int key_len;
res = srtp_filter_.GetRtpAuthParams(
- &auth_key, &key_len, &options.packet_time_params.srtp_auth_tag_len);
+ &auth_key, &key_len,
+ &updated_options.packet_time_params.srtp_auth_tag_len);
if (res) {
- options.packet_time_params.srtp_auth_key.resize(key_len);
- options.packet_time_params.srtp_auth_key.assign(auth_key,
- auth_key + key_len);
+ updated_options.packet_time_params.srtp_auth_key.resize(key_len);
+ updated_options.packet_time_params.srtp_auth_key.assign(
+ auth_key, auth_key + key_len);
}
}
#endif
@@ -1244,7 +1249,8 @@ void BaseChannel::OnMessage(rtc::Message *pmsg) {
case MSG_RTPPACKET:
case MSG_RTCPPACKET: {
PacketMessageData* data = static_cast<PacketMessageData*>(pmsg->pdata);
- SendPacket(pmsg->message_id == MSG_RTCPPACKET, &data->packet, data->dscp);
+ SendPacket(pmsg->message_id == MSG_RTCPPACKET, &data->packet,
+ data->options);
delete data; // because it is Posted
break;
}

Powered by Google App Engine
This is Rietveld 408576698