Update libjingle 61901702->61966318
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5596 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
a7b981843f
commit
d43aa9de7a
@ -30,8 +30,8 @@
|
|||||||
|
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
|
|
||||||
#if (OPENSSL_VERSION_NUMBER < 0x10001000L)
|
#if (OPENSSL_VERSION_NUMBER < 0x10000000L)
|
||||||
#error OpenSSL is older than 1.0.1, which is the minimum supported version.
|
#error OpenSSL is older than 1.0.0, which is the minimum supported version.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // TALK_BASE_OPENSSL_H_
|
#endif // TALK_BASE_OPENSSL_H_
|
||||||
|
@ -53,6 +53,11 @@
|
|||||||
|
|
||||||
namespace talk_base {
|
namespace talk_base {
|
||||||
|
|
||||||
|
#if (OPENSSL_VERSION_NUMBER >= 0x10001000L)
|
||||||
|
#define HAVE_DTLS_SRTP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_DTLS_SRTP
|
||||||
// SRTP cipher suite table
|
// SRTP cipher suite table
|
||||||
struct SrtpCipherMapEntry {
|
struct SrtpCipherMapEntry {
|
||||||
const char* external_name;
|
const char* external_name;
|
||||||
@ -65,6 +70,7 @@ static SrtpCipherMapEntry SrtpCipherMap[] = {
|
|||||||
{"AES_CM_128_HMAC_SHA1_32", "SRTP_AES128_CM_SHA1_32"},
|
{"AES_CM_128_HMAC_SHA1_32", "SRTP_AES128_CM_SHA1_32"},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// StreamBIO
|
// StreamBIO
|
||||||
@ -238,6 +244,7 @@ bool OpenSSLStreamAdapter::ExportKeyingMaterial(const std::string& label,
|
|||||||
bool use_context,
|
bool use_context,
|
||||||
uint8* result,
|
uint8* result,
|
||||||
size_t result_len) {
|
size_t result_len) {
|
||||||
|
#ifdef HAVE_DTLS_SRTP
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = SSL_export_keying_material(ssl_, result, result_len,
|
i = SSL_export_keying_material(ssl_, result, result_len,
|
||||||
@ -249,10 +256,14 @@ bool OpenSSLStreamAdapter::ExportKeyingMaterial(const std::string& label,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OpenSSLStreamAdapter::SetDtlsSrtpCiphers(
|
bool OpenSSLStreamAdapter::SetDtlsSrtpCiphers(
|
||||||
const std::vector<std::string>& ciphers) {
|
const std::vector<std::string>& ciphers) {
|
||||||
|
#ifdef HAVE_DTLS_SRTP
|
||||||
std::string internal_ciphers;
|
std::string internal_ciphers;
|
||||||
|
|
||||||
if (state_ != SSL_NONE)
|
if (state_ != SSL_NONE)
|
||||||
@ -283,9 +294,13 @@ bool OpenSSLStreamAdapter::SetDtlsSrtpCiphers(
|
|||||||
|
|
||||||
srtp_ciphers_ = internal_ciphers;
|
srtp_ciphers_ = internal_ciphers;
|
||||||
return true;
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OpenSSLStreamAdapter::GetDtlsSrtpCipher(std::string* cipher) {
|
bool OpenSSLStreamAdapter::GetDtlsSrtpCipher(std::string* cipher) {
|
||||||
|
#ifdef HAVE_DTLS_SRTP
|
||||||
ASSERT(state_ == SSL_CONNECTED);
|
ASSERT(state_ == SSL_CONNECTED);
|
||||||
if (state_ != SSL_CONNECTED)
|
if (state_ != SSL_CONNECTED)
|
||||||
return false;
|
return false;
|
||||||
@ -307,6 +322,9 @@ bool OpenSSLStreamAdapter::GetDtlsSrtpCipher(std::string* cipher) {
|
|||||||
ASSERT(false); // This should never happen
|
ASSERT(false); // This should never happen
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int OpenSSLStreamAdapter::StartSSLWithServer(const char* server_name) {
|
int OpenSSLStreamAdapter::StartSSLWithServer(const char* server_name) {
|
||||||
@ -737,12 +755,14 @@ SSL_CTX* OpenSSLStreamAdapter::SetupSSLContext() {
|
|||||||
SSL_CTX_set_verify_depth(ctx, 4);
|
SSL_CTX_set_verify_depth(ctx, 4);
|
||||||
SSL_CTX_set_cipher_list(ctx, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
SSL_CTX_set_cipher_list(ctx, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
|
||||||
|
|
||||||
|
#ifdef HAVE_DTLS_SRTP
|
||||||
if (!srtp_ciphers_.empty()) {
|
if (!srtp_ciphers_.empty()) {
|
||||||
if (SSL_CTX_set_tlsext_use_srtp(ctx, srtp_ciphers_.c_str())) {
|
if (SSL_CTX_set_tlsext_use_srtp(ctx, srtp_ciphers_.c_str())) {
|
||||||
SSL_CTX_free(ctx);
|
SSL_CTX_free(ctx);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
@ -820,11 +840,19 @@ bool OpenSSLStreamAdapter::HaveDtls() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool OpenSSLStreamAdapter::HaveDtlsSrtp() {
|
bool OpenSSLStreamAdapter::HaveDtlsSrtp() {
|
||||||
|
#ifdef HAVE_DTLS_SRTP
|
||||||
return true;
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OpenSSLStreamAdapter::HaveExporter() {
|
bool OpenSSLStreamAdapter::HaveExporter() {
|
||||||
|
#ifdef HAVE_DTLS_SRTP
|
||||||
return true;
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace talk_base
|
} // namespace talk_base
|
||||||
|
@ -96,4 +96,7 @@ const char kGoogleSctpDataCodecName[] = "google-sctp-data";
|
|||||||
|
|
||||||
const char kComfortNoiseCodecName[] = "CN";
|
const char kComfortNoiseCodecName[] = "CN";
|
||||||
|
|
||||||
|
const char kRtpAbsoluteSendTimeHeaderExtension[] =
|
||||||
|
"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time";
|
||||||
|
|
||||||
} // namespace cricket
|
} // namespace cricket
|
||||||
|
@ -116,6 +116,10 @@ extern const char kGoogleSctpDataCodecName[];
|
|||||||
|
|
||||||
extern const char kComfortNoiseCodecName[];
|
extern const char kComfortNoiseCodecName[];
|
||||||
|
|
||||||
|
// Extension header for absolute send time, see url for details:
|
||||||
|
// http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
|
||||||
|
extern const char kRtpAbsoluteSendTimeHeaderExtension[];
|
||||||
|
|
||||||
} // namespace cricket
|
} // namespace cricket
|
||||||
|
|
||||||
#endif // TALK_MEDIA_BASE_CONSTANTS_H_
|
#endif // TALK_MEDIA_BASE_CONSTANTS_H_
|
||||||
|
@ -211,6 +211,12 @@ void CoordinatedVideoAdapter::SetInputFormat(const VideoFormat& format) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CoordinatedVideoAdapter::set_cpu_smoothing(bool enable) {
|
||||||
|
LOG(LS_INFO) << "CPU smoothing is now "
|
||||||
|
<< (enable ? "enabled" : "disabled");
|
||||||
|
cpu_smoothing_ = enable;
|
||||||
|
}
|
||||||
|
|
||||||
void VideoAdapter::SetOutputFormat(const VideoFormat& format) {
|
void VideoAdapter::SetOutputFormat(const VideoFormat& format) {
|
||||||
talk_base::CritScope cs(&critical_section_);
|
talk_base::CritScope cs(&critical_section_);
|
||||||
int64 old_output_interval = output_format_.interval;
|
int64 old_output_interval = output_format_.interval;
|
||||||
@ -361,6 +367,12 @@ bool VideoAdapter::AdaptFrame(const VideoFrame* in_frame,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VideoAdapter::set_scale_third(bool enable) {
|
||||||
|
LOG(LS_INFO) << "Video Adapter third scaling is now "
|
||||||
|
<< (enable ? "enabled" : "disabled");
|
||||||
|
scale_third_ = enable;
|
||||||
|
}
|
||||||
|
|
||||||
// Scale or Blacken the frame. Returns true if successful.
|
// Scale or Blacken the frame. Returns true if successful.
|
||||||
bool VideoAdapter::StretchToOutputFrame(const VideoFrame* in_frame) {
|
bool VideoAdapter::StretchToOutputFrame(const VideoFrame* in_frame) {
|
||||||
int output_width = output_format_.width;
|
int output_width = output_format_.width;
|
||||||
@ -481,6 +493,48 @@ void CoordinatedVideoAdapter::OnOutputFormatRequest(const VideoFormat& format) {
|
|||||||
<< " To: " << new_width << "x" << new_height;
|
<< " To: " << new_width << "x" << new_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CoordinatedVideoAdapter::set_cpu_load_min_samples(
|
||||||
|
int cpu_load_min_samples) {
|
||||||
|
if (cpu_load_min_samples_ != cpu_load_min_samples) {
|
||||||
|
LOG(LS_INFO) << "VAdapt Change Cpu Adapt Min Samples from: "
|
||||||
|
<< cpu_load_min_samples_ << " to "
|
||||||
|
<< cpu_load_min_samples;
|
||||||
|
cpu_load_min_samples_ = cpu_load_min_samples;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CoordinatedVideoAdapter::set_high_system_threshold(
|
||||||
|
float high_system_threshold) {
|
||||||
|
ASSERT(high_system_threshold <= 1.0f);
|
||||||
|
ASSERT(high_system_threshold >= 0.0f);
|
||||||
|
if (high_system_threshold_ != high_system_threshold) {
|
||||||
|
LOG(LS_INFO) << "VAdapt Change High System Threshold from: "
|
||||||
|
<< high_system_threshold_ << " to " << high_system_threshold;
|
||||||
|
high_system_threshold_ = high_system_threshold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CoordinatedVideoAdapter::set_low_system_threshold(
|
||||||
|
float low_system_threshold) {
|
||||||
|
ASSERT(low_system_threshold <= 1.0f);
|
||||||
|
ASSERT(low_system_threshold >= 0.0f);
|
||||||
|
if (low_system_threshold_ != low_system_threshold) {
|
||||||
|
LOG(LS_INFO) << "VAdapt Change Low System Threshold from: "
|
||||||
|
<< low_system_threshold_ << " to " << low_system_threshold;
|
||||||
|
low_system_threshold_ = low_system_threshold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CoordinatedVideoAdapter::set_process_threshold(float process_threshold) {
|
||||||
|
ASSERT(process_threshold <= 1.0f);
|
||||||
|
ASSERT(process_threshold >= 0.0f);
|
||||||
|
if (process_threshold_ != process_threshold) {
|
||||||
|
LOG(LS_INFO) << "VAdapt Change High Process Threshold from: "
|
||||||
|
<< process_threshold_ << " to " << process_threshold;
|
||||||
|
process_threshold_ = process_threshold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// A Bandwidth GD request for new resolution
|
// A Bandwidth GD request for new resolution
|
||||||
void CoordinatedVideoAdapter::OnEncoderResolutionRequest(
|
void CoordinatedVideoAdapter::OnEncoderResolutionRequest(
|
||||||
int width, int height, AdaptRequest request) {
|
int width, int height, AdaptRequest request) {
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
|
|
||||||
#include "talk/base/common.h" // For ASSERT
|
#include "talk/base/common.h" // For ASSERT
|
||||||
#include "talk/base/criticalsection.h"
|
#include "talk/base/criticalsection.h"
|
||||||
#include "talk/base/logging.h"
|
|
||||||
#include "talk/base/scoped_ptr.h"
|
#include "talk/base/scoped_ptr.h"
|
||||||
#include "talk/base/sigslot.h"
|
#include "talk/base/sigslot.h"
|
||||||
#include "talk/media/base/videocommon.h"
|
#include "talk/media/base/videocommon.h"
|
||||||
@ -64,11 +63,7 @@ class VideoAdapter {
|
|||||||
// the output frame.
|
// the output frame.
|
||||||
bool AdaptFrame(const VideoFrame* in_frame, VideoFrame** out_frame);
|
bool AdaptFrame(const VideoFrame* in_frame, VideoFrame** out_frame);
|
||||||
|
|
||||||
void set_scale_third(bool enable) {
|
void set_scale_third(bool enable);
|
||||||
LOG(LS_INFO) << "Video Adapter third scaling is now "
|
|
||||||
<< (enable ? "enabled" : "disabled");
|
|
||||||
scale_third_ = enable;
|
|
||||||
}
|
|
||||||
bool scale_third() const { return scale_third_; }
|
bool scale_third() const { return scale_third_; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -129,11 +124,7 @@ class CoordinatedVideoAdapter
|
|||||||
// Enable or disable smoothing when doing CPU adaptation. When smoothing is
|
// Enable or disable smoothing when doing CPU adaptation. When smoothing is
|
||||||
// enabled, system CPU load is tracked using an exponential weighted
|
// enabled, system CPU load is tracked using an exponential weighted
|
||||||
// average.
|
// average.
|
||||||
void set_cpu_smoothing(bool enable) {
|
void set_cpu_smoothing(bool enable);
|
||||||
LOG(LS_INFO) << "CPU smoothing is now "
|
|
||||||
<< (enable ? "enabled" : "disabled");
|
|
||||||
cpu_smoothing_ = enable;
|
|
||||||
}
|
|
||||||
bool cpu_smoothing() const { return cpu_smoothing_; }
|
bool cpu_smoothing() const { return cpu_smoothing_; }
|
||||||
// Enable or disable video adaptation due to the change of the GD
|
// Enable or disable video adaptation due to the change of the GD
|
||||||
void set_gd_adaptation(bool enable) { gd_adaptation_ = enable; }
|
void set_gd_adaptation(bool enable) { gd_adaptation_ = enable; }
|
||||||
@ -151,47 +142,16 @@ class CoordinatedVideoAdapter
|
|||||||
|
|
||||||
// When the video is decreased, set the waiting time for CPU adaptation to
|
// When the video is decreased, set the waiting time for CPU adaptation to
|
||||||
// decrease video again.
|
// decrease video again.
|
||||||
void set_cpu_load_min_samples(int cpu_load_min_samples) {
|
void set_cpu_load_min_samples(int cpu_load_min_samples);
|
||||||
if (cpu_load_min_samples_ != cpu_load_min_samples) {
|
|
||||||
LOG(LS_INFO) << "VAdapt Change Cpu Adapt Min Samples from: "
|
|
||||||
<< cpu_load_min_samples_ << " to "
|
|
||||||
<< cpu_load_min_samples;
|
|
||||||
cpu_load_min_samples_ = cpu_load_min_samples;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int cpu_load_min_samples() const { return cpu_load_min_samples_; }
|
int cpu_load_min_samples() const { return cpu_load_min_samples_; }
|
||||||
// CPU system load high threshold for reducing resolution. e.g. 0.85f
|
// CPU system load high threshold for reducing resolution. e.g. 0.85f
|
||||||
void set_high_system_threshold(float high_system_threshold) {
|
void set_high_system_threshold(float high_system_threshold);
|
||||||
ASSERT(high_system_threshold <= 1.0f);
|
|
||||||
ASSERT(high_system_threshold >= 0.0f);
|
|
||||||
if (high_system_threshold_ != high_system_threshold) {
|
|
||||||
LOG(LS_INFO) << "VAdapt Change High System Threshold from: "
|
|
||||||
<< high_system_threshold_ << " to " << high_system_threshold;
|
|
||||||
high_system_threshold_ = high_system_threshold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
float high_system_threshold() const { return high_system_threshold_; }
|
float high_system_threshold() const { return high_system_threshold_; }
|
||||||
// CPU system load low threshold for increasing resolution. e.g. 0.70f
|
// CPU system load low threshold for increasing resolution. e.g. 0.70f
|
||||||
void set_low_system_threshold(float low_system_threshold) {
|
void set_low_system_threshold(float low_system_threshold);
|
||||||
ASSERT(low_system_threshold <= 1.0f);
|
|
||||||
ASSERT(low_system_threshold >= 0.0f);
|
|
||||||
if (low_system_threshold_ != low_system_threshold) {
|
|
||||||
LOG(LS_INFO) << "VAdapt Change Low System Threshold from: "
|
|
||||||
<< low_system_threshold_ << " to " << low_system_threshold;
|
|
||||||
low_system_threshold_ = low_system_threshold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
float low_system_threshold() const { return low_system_threshold_; }
|
float low_system_threshold() const { return low_system_threshold_; }
|
||||||
// CPU process load threshold for reducing resolution. e.g. 0.10f
|
// CPU process load threshold for reducing resolution. e.g. 0.10f
|
||||||
void set_process_threshold(float process_threshold) {
|
void set_process_threshold(float process_threshold);
|
||||||
ASSERT(process_threshold <= 1.0f);
|
|
||||||
ASSERT(process_threshold >= 0.0f);
|
|
||||||
if (process_threshold_ != process_threshold) {
|
|
||||||
LOG(LS_INFO) << "VAdapt Change High Process Threshold from: "
|
|
||||||
<< process_threshold_ << " to " << process_threshold;
|
|
||||||
process_threshold_ = process_threshold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
float process_threshold() const { return process_threshold_; }
|
float process_threshold() const { return process_threshold_; }
|
||||||
|
|
||||||
// Handle the format request from the server via Jingle update message.
|
// Handle the format request from the server via Jingle update message.
|
||||||
|
@ -152,10 +152,7 @@ static const char kRtpTimestampOffsetHeaderExtension[] =
|
|||||||
"urn:ietf:params:rtp-hdrext:toffset";
|
"urn:ietf:params:rtp-hdrext:toffset";
|
||||||
static const int kRtpTimeOffsetExtensionId = 2;
|
static const int kRtpTimeOffsetExtensionId = 2;
|
||||||
|
|
||||||
// Extension header for absolute send time, see url for details:
|
// Extension header ID for absolute send time. Url defined in constants.cc
|
||||||
// http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
|
|
||||||
static const char kRtpAbsoluteSendTimeHeaderExtension[] =
|
|
||||||
"http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time";
|
|
||||||
static const int kRtpAbsoluteSendTimeExtensionId = 3;
|
static const int kRtpAbsoluteSendTimeExtensionId = 3;
|
||||||
// Default video dscp value.
|
// Default video dscp value.
|
||||||
// See http://tools.ietf.org/html/rfc2474 for details
|
// See http://tools.ietf.org/html/rfc2474 for details
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "talk/base/common.h"
|
#include "talk/base/common.h"
|
||||||
#include "talk/base/dscp.h"
|
#include "talk/base/dscp.h"
|
||||||
#include "talk/base/logging.h"
|
#include "talk/base/logging.h"
|
||||||
|
#include "talk/media/base/constants.h"
|
||||||
#include "talk/media/base/rtputils.h"
|
#include "talk/media/base/rtputils.h"
|
||||||
#include "talk/p2p/base/transportchannel.h"
|
#include "talk/p2p/base/transportchannel.h"
|
||||||
#include "talk/session/media/channelmanager.h"
|
#include "talk/session/media/channelmanager.h"
|
||||||
@ -186,7 +187,8 @@ BaseChannel::BaseChannel(talk_base::Thread* thread,
|
|||||||
remote_content_direction_(MD_INACTIVE),
|
remote_content_direction_(MD_INACTIVE),
|
||||||
has_received_packet_(false),
|
has_received_packet_(false),
|
||||||
dtls_keyed_(false),
|
dtls_keyed_(false),
|
||||||
secure_required_(false) {
|
secure_required_(false),
|
||||||
|
rtp_abs_sendtime_extn_id_(-1) {
|
||||||
ASSERT(worker_thread_ == talk_base::Thread::Current());
|
ASSERT(worker_thread_ == talk_base::Thread::Current());
|
||||||
LOG(LS_INFO) << "Created channel for " << content_name;
|
LOG(LS_INFO) << "Created channel for " << content_name;
|
||||||
}
|
}
|
||||||
@ -462,14 +464,40 @@ bool BaseChannel::SendPacket(bool rtcp, talk_base::Buffer* packet,
|
|||||||
SignalSendPacketPreCrypto(packet->data(), packet->length(), rtcp);
|
SignalSendPacketPreCrypto(packet->data(), packet->length(), rtcp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
talk_base::PacketOptions options(dscp);
|
||||||
|
options.packet_time_params.rtp_sendtime_extension_id =
|
||||||
|
rtp_abs_sendtime_extn_id_;
|
||||||
// Protect if needed.
|
// Protect if needed.
|
||||||
if (srtp_filter_.IsActive()) {
|
if (srtp_filter_.IsActive()) {
|
||||||
bool res;
|
bool res;
|
||||||
char* data = packet->data();
|
char* data = packet->data();
|
||||||
int len = static_cast<int>(packet->length());
|
int len = static_cast<int>(packet->length());
|
||||||
if (!rtcp) {
|
if (!rtcp) {
|
||||||
res = srtp_filter_.ProtectRtp(data, len,
|
// If ENABLE_EXTERNAL_AUTH flag is on then packet authentication is not done
|
||||||
static_cast<int>(packet->capacity()), &len);
|
// inside libsrtp for a RTP packet. A external HMAC module will be writing
|
||||||
|
// a fake HMAC value. This is ONLY done for a RTP packet.
|
||||||
|
// Socket layer will update rtp sendtime extension header if present in
|
||||||
|
// packet with current time before updating the HMAC.
|
||||||
|
#if !defined(ENABLE_EXTERNAL_AUTH)
|
||||||
|
res = srtp_filter_.ProtectRtp(
|
||||||
|
data, len, static_cast<int>(packet->capacity()), &len);
|
||||||
|
#else
|
||||||
|
res = srtp_filter_.ProtectRtp(
|
||||||
|
data, len, static_cast<int>(packet->capacity()), &len,
|
||||||
|
&options.packet_time_params.srtp_packet_index);
|
||||||
|
// If protection succeeds, let's get auth params from srtp.
|
||||||
|
if (res) {
|
||||||
|
uint8* auth_key = NULL;
|
||||||
|
int key_len;
|
||||||
|
res = srtp_filter_.GetRtpAuthParams(
|
||||||
|
&auth_key, &key_len, &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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!res) {
|
if (!res) {
|
||||||
int seq_num = -1;
|
int seq_num = -1;
|
||||||
uint32 ssrc = 0;
|
uint32 ssrc = 0;
|
||||||
@ -511,7 +539,6 @@ bool BaseChannel::SendPacket(bool rtcp, talk_base::Buffer* packet,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Bon voyage.
|
// Bon voyage.
|
||||||
talk_base::PacketOptions options(dscp);
|
|
||||||
int ret = channel->SendPacket(packet->data(), packet->length(), options,
|
int ret = channel->SendPacket(packet->data(), packet->length(), options,
|
||||||
(secure() && secure_dtls()) ? PF_SRTP_BYPASS : 0);
|
(secure() && secure_dtls()) ? PF_SRTP_BYPASS : 0);
|
||||||
if (ret != static_cast<int>(packet->length())) {
|
if (ret != static_cast<int>(packet->length())) {
|
||||||
@ -1170,6 +1197,8 @@ bool BaseChannel::SetBaseRemoteContent_w(const MediaContentDescription* content,
|
|||||||
<< MediaTypeToString(content->type()) << " content.";
|
<< MediaTypeToString(content->type()) << " content.";
|
||||||
SafeSetError(desc.str(), error_desc);
|
SafeSetError(desc.str(), error_desc);
|
||||||
ret = false;
|
ret = false;
|
||||||
|
} else {
|
||||||
|
MaybeCacheRtpAbsSendTimeHeaderExtension(content->rtp_header_extensions());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1184,6 +1213,14 @@ bool BaseChannel::SetBaseRemoteContent_w(const MediaContentDescription* content,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BaseChannel::MaybeCacheRtpAbsSendTimeHeaderExtension(
|
||||||
|
const std::vector<RtpHeaderExtension>& extensions) {
|
||||||
|
const RtpHeaderExtension* send_time_extension =
|
||||||
|
FindHeaderExtension(extensions, kRtpAbsoluteSendTimeHeaderExtension);
|
||||||
|
rtp_abs_sendtime_extn_id_ =
|
||||||
|
send_time_extension ? send_time_extension->id : -1;
|
||||||
|
}
|
||||||
|
|
||||||
void BaseChannel::OnMessage(talk_base::Message *pmsg) {
|
void BaseChannel::OnMessage(talk_base::Message *pmsg) {
|
||||||
switch (pmsg->message_id) {
|
switch (pmsg->message_id) {
|
||||||
case MSG_RTPPACKET:
|
case MSG_RTPPACKET:
|
||||||
|
@ -319,6 +319,11 @@ class BaseChannel
|
|||||||
ContentAction action,
|
ContentAction action,
|
||||||
std::string* error_desc) = 0;
|
std::string* error_desc) = 0;
|
||||||
|
|
||||||
|
// Helper method to get RTP Absoulute SendTime extension header id if
|
||||||
|
// present in remote supported extensions list.
|
||||||
|
void MaybeCacheRtpAbsSendTimeHeaderExtension(
|
||||||
|
const std::vector<RtpHeaderExtension>& extensions);
|
||||||
|
|
||||||
bool CheckSrtpConfig(const std::vector<CryptoParams>& cryptos,
|
bool CheckSrtpConfig(const std::vector<CryptoParams>& cryptos,
|
||||||
bool* dtls,
|
bool* dtls,
|
||||||
std::string* error_desc);
|
std::string* error_desc);
|
||||||
@ -380,6 +385,7 @@ class BaseChannel
|
|||||||
bool has_received_packet_;
|
bool has_received_packet_;
|
||||||
bool dtls_keyed_;
|
bool dtls_keyed_;
|
||||||
bool secure_required_;
|
bool secure_required_;
|
||||||
|
int rtp_abs_sendtime_extn_id_;
|
||||||
};
|
};
|
||||||
|
|
||||||
// VoiceChannel is a specialization that adds support for early media, DTMF,
|
// VoiceChannel is a specialization that adds support for early media, DTMF,
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#include "third_party/libsrtp/include/srtp.h"
|
#include "third_party/libsrtp/include/srtp.h"
|
||||||
#endif // SRTP_RELATIVE_PATH
|
#endif // SRTP_RELATIVE_PATH
|
||||||
|
|
||||||
#include "talk/session/media/external_hmac.h"
|
#include "talk/session/media/externalhmac.h"
|
||||||
|
|
||||||
#include "talk/base/logging.h"
|
#include "talk/base/logging.h"
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ extern "C" srtp_stream_t srtp_get_stream(srtp_t srtp, uint32_t ssrc);
|
|||||||
#include "third_party/libsrtp/include/srtp_priv.h"
|
#include "third_party/libsrtp/include/srtp_priv.h"
|
||||||
#endif // SRTP_RELATIVE_PATH
|
#endif // SRTP_RELATIVE_PATH
|
||||||
#ifdef ENABLE_EXTERNAL_AUTH
|
#ifdef ENABLE_EXTERNAL_AUTH
|
||||||
#include "talk/session/media/external_hmac.h"
|
#include "talk/session/media/externalhmac.h"
|
||||||
#endif // ENABLE_EXTERNAL_AUTH
|
#endif // ENABLE_EXTERNAL_AUTH
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
extern "C" debug_module_t mod_srtp;
|
extern "C" debug_module_t mod_srtp;
|
||||||
|
@ -118,6 +118,7 @@ const char STR_MUC_ROOM_FEATURE_HANGOUT[] = "muc_es";
|
|||||||
const char STR_MUC_ROOM_FEATURE_HANGOUT_LITE[] = "muc_lite";
|
const char STR_MUC_ROOM_FEATURE_HANGOUT_LITE[] = "muc_lite";
|
||||||
const char STR_MUC_ROOM_FEATURE_BROADCAST[] = "broadcast";
|
const char STR_MUC_ROOM_FEATURE_BROADCAST[] = "broadcast";
|
||||||
const char STR_MUC_ROOM_FEATURE_MULTI_USER_VC[] = "muc_muvc";
|
const char STR_MUC_ROOM_FEATURE_MULTI_USER_VC[] = "muc_muvc";
|
||||||
|
const char STR_MUC_ROOM_FEATURE_RECORDABLE[] = "recordable";
|
||||||
const char STR_MUC_ROOM_OWNER_PROFILE_ID[] = "muc#roominfo_owner_profile_id";
|
const char STR_MUC_ROOM_OWNER_PROFILE_ID[] = "muc#roominfo_owner_profile_id";
|
||||||
|
|
||||||
const char STR_ID_TYPE_CONVERSATION[] = "conversation";
|
const char STR_ID_TYPE_CONVERSATION[] = "conversation";
|
||||||
|
@ -111,6 +111,7 @@ extern const char STR_MUC_ROOM_FEATURE_HANGOUT[];
|
|||||||
extern const char STR_MUC_ROOM_FEATURE_HANGOUT_LITE[];
|
extern const char STR_MUC_ROOM_FEATURE_HANGOUT_LITE[];
|
||||||
extern const char STR_MUC_ROOM_FEATURE_BROADCAST[];
|
extern const char STR_MUC_ROOM_FEATURE_BROADCAST[];
|
||||||
extern const char STR_MUC_ROOM_FEATURE_MULTI_USER_VC[];
|
extern const char STR_MUC_ROOM_FEATURE_MULTI_USER_VC[];
|
||||||
|
extern const char STR_MUC_ROOM_FEATURE_RECORDABLE[];
|
||||||
extern const char STR_MUC_ROOM_OWNER_PROFILE_ID[];
|
extern const char STR_MUC_ROOM_OWNER_PROFILE_ID[];
|
||||||
|
|
||||||
extern const char STR_ID_TYPE_CONVERSATION[];
|
extern const char STR_ID_TYPE_CONVERSATION[];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user