diff --git a/webrtc/config.cc b/webrtc/config.cc new file mode 100644 index 000000000..021bbbfcd --- /dev/null +++ b/webrtc/config.cc @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "webrtc/config.h" + +namespace webrtc { +const char* RtpExtension::kTOffset = "urn:ietf:params:rtp-hdrext:toffset"; +const char* RtpExtension::kAbsSendTime = + "http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time"; +} // namespace webrtc diff --git a/webrtc/config.h b/webrtc/config.h index a00a8f9ba..3ff3bb861 100644 --- a/webrtc/config.h +++ b/webrtc/config.h @@ -16,6 +16,8 @@ #include #include +#include "webrtc/typedefs.h" + namespace webrtc { struct RtpStatistics { @@ -67,6 +69,8 @@ struct RtxConfig { // RTP header extension to use for the video stream, see RFC 5285. struct RtpExtension { + static const char* kTOffset; + static const char* kAbsSendTime; RtpExtension(const char* name, int id) : name(name), id(id) {} // TODO(mflodman) Add API to query supported extensions. std::string name; diff --git a/webrtc/video/rampup_tests.cc b/webrtc/video/rampup_tests.cc index d858c3dd2..6ce347a97 100644 --- a/webrtc/video/rampup_tests.cc +++ b/webrtc/video/rampup_tests.cc @@ -155,7 +155,7 @@ TEST_P(RampUpTest, RampUpWithPadding) { send_config.codec.plType = 125; send_config.pacing = GetParam(); send_config.rtp.extensions.push_back( - RtpExtension("toffset", kTOffsetExtensionId)); + RtpExtension(RtpExtension::kTOffset, kTOffsetExtensionId)); test::GenerateRandomSsrcs(&send_config, &reserved_ssrcs_); diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc index db1cb0227..cc723b61c 100644 --- a/webrtc/video/video_send_stream.cc +++ b/webrtc/video/video_send_stream.cc @@ -123,10 +123,10 @@ VideoSendStream::VideoSendStream(newapi::Transport* transport, for (size_t i = 0; i < config_.rtp.extensions.size(); ++i) { const std::string& extension = config_.rtp.extensions[i].name; int id = config_.rtp.extensions[i].id; - if (extension == "toffset") { + if (extension == RtpExtension::kTOffset) { if (rtp_rtcp_->SetSendTimestampOffsetStatus(channel_, true, id) != 0) abort(); - } else if (extension == "abs-send-time") { + } else if (extension == RtpExtension::kAbsSendTime) { if (rtp_rtcp_->SetSendAbsoluteSendTimeStatus(channel_, true, id) != 0) abort(); } else { diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc index 32eb961f0..0affdbd1e 100644 --- a/webrtc/video/video_send_stream_tests.cc +++ b/webrtc/video/video_send_stream_tests.cc @@ -170,7 +170,7 @@ TEST_F(VideoSendStreamTest, SupportsAbsoluteSendTime) { VideoSendStream::Config send_config = GetSendTestConfig(call.get()); send_config.rtp.extensions.push_back( - RtpExtension("abs-send-time", kAbsSendTimeExtensionId)); + RtpExtension(RtpExtension::kAbsSendTime, kAbsSendTimeExtensionId)); RunSendTest(call.get(), send_config, &observer); } @@ -216,7 +216,7 @@ TEST_F(VideoSendStreamTest, SupportsTransmissionTimeOffset) { VideoSendStream::Config send_config = GetSendTestConfig(call.get()); send_config.encoder = &encoder; send_config.rtp.extensions.push_back( - RtpExtension("toffset", kTOffsetExtensionId)); + RtpExtension(RtpExtension::kTOffset, kTOffsetExtensionId)); RunSendTest(call.get(), send_config, &observer); } diff --git a/webrtc/webrtc.gyp b/webrtc/webrtc.gyp index 9fe514cb0..a223007dd 100644 --- a/webrtc/webrtc.gyp +++ b/webrtc/webrtc.gyp @@ -61,6 +61,7 @@ 'sources': [ 'call.cc', 'call.h', + 'config.cc', 'config.h', 'frame_callback.h', 'transport.h',