(Auto)update libjingle 72097588-> 72159069

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6799 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
buildbot@webrtc.org 2014-07-29 17:36:52 +00:00
parent fc8b0871d9
commit d4e598d57a
509 changed files with 7114 additions and 7239 deletions

View File

@ -42,10 +42,10 @@ std::string AudioTrack::kind() const {
return kAudioTrackKind;
}
talk_base::scoped_refptr<AudioTrack> AudioTrack::Create(
rtc::scoped_refptr<AudioTrack> AudioTrack::Create(
const std::string& id, AudioSourceInterface* source) {
talk_base::RefCountedObject<AudioTrack>* track =
new talk_base::RefCountedObject<AudioTrack>(id, source);
rtc::RefCountedObject<AudioTrack>* track =
new rtc::RefCountedObject<AudioTrack>(id, source);
return track;
}

View File

@ -31,14 +31,14 @@
#include "talk/app/webrtc/mediastreaminterface.h"
#include "talk/app/webrtc/mediastreamtrack.h"
#include "talk/app/webrtc/notifier.h"
#include "talk/base/scoped_ptr.h"
#include "talk/base/scoped_ref_ptr.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/scoped_ref_ptr.h"
namespace webrtc {
class AudioTrack : public MediaStreamTrack<AudioTrackInterface> {
public:
static talk_base::scoped_refptr<AudioTrack> Create(
static rtc::scoped_refptr<AudioTrack> Create(
const std::string& id, AudioSourceInterface* source);
// AudioTrackInterface implementation.
@ -49,7 +49,7 @@ class AudioTrack : public MediaStreamTrack<AudioTrackInterface> {
virtual void AddSink(AudioTrackSinkInterface* sink) OVERRIDE {}
virtual void RemoveSink(AudioTrackSinkInterface* sink) OVERRIDE {}
virtual bool GetSignalLevel(int* level) OVERRIDE { return false; }
virtual talk_base::scoped_refptr<AudioProcessorInterface> GetAudioProcessor()
virtual rtc::scoped_refptr<AudioProcessorInterface> GetAudioProcessor()
OVERRIDE { return NULL; }
virtual cricket::AudioRenderer* GetRenderer() OVERRIDE {
return NULL;
@ -62,7 +62,7 @@ class AudioTrack : public MediaStreamTrack<AudioTrackInterface> {
AudioTrack(const std::string& label, AudioSourceInterface* audio_source);
private:
talk_base::scoped_refptr<AudioSourceInterface> audio_source_;
rtc::scoped_refptr<AudioSourceInterface> audio_source_;
};
} // namespace webrtc

View File

@ -26,7 +26,7 @@
*/
#include "talk/app/webrtc/audiotrackrenderer.h"
#include "talk/base/common.h"
#include "webrtc/base/common.h"
namespace webrtc {

View File

@ -28,7 +28,7 @@
#ifndef TALK_APP_WEBRTC_AUDIOTRACKRENDERER_H_
#define TALK_APP_WEBRTC_AUDIOTRACKRENDERER_H_
#include "talk/base/thread.h"
#include "webrtc/base/thread.h"
#include "talk/media/base/audiorenderer.h"
namespace webrtc {

View File

@ -30,8 +30,8 @@
#include "talk/app/webrtc/mediastreamprovider.h"
#include "talk/app/webrtc/sctputils.h"
#include "talk/base/logging.h"
#include "talk/base/refcount.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/refcount.h"
namespace webrtc {
@ -86,13 +86,13 @@ void DataChannel::PacketQueue::Swap(PacketQueue* other) {
other->packets_.swap(packets_);
}
talk_base::scoped_refptr<DataChannel> DataChannel::Create(
rtc::scoped_refptr<DataChannel> DataChannel::Create(
DataChannelProviderInterface* provider,
cricket::DataChannelType dct,
const std::string& label,
const InternalDataChannelInit& config) {
talk_base::scoped_refptr<DataChannel> channel(
new talk_base::RefCountedObject<DataChannel>(provider, dct, label));
rtc::scoped_refptr<DataChannel> channel(
new rtc::RefCountedObject<DataChannel>(provider, dct, label));
if (!channel->Init(config)) {
return NULL;
}
@ -151,7 +151,7 @@ bool DataChannel::Init(const InternalDataChannelInit& config) {
// Chrome glue and WebKit) are not wired up properly until after this
// function returns.
if (provider_->ReadyToSendData()) {
talk_base::Thread::Current()->Post(this, MSG_CHANNELREADY, NULL);
rtc::Thread::Current()->Post(this, MSG_CHANNELREADY, NULL);
}
}
@ -271,7 +271,7 @@ void DataChannel::SetSendSsrc(uint32 send_ssrc) {
UpdateState();
}
void DataChannel::OnMessage(talk_base::Message* msg) {
void DataChannel::OnMessage(rtc::Message* msg) {
switch (msg->message_id) {
case MSG_CHANNELREADY:
OnChannelReady(true);
@ -288,7 +288,7 @@ void DataChannel::OnDataEngineClose() {
void DataChannel::OnDataReceived(cricket::DataChannel* channel,
const cricket::ReceiveDataParams& params,
const talk_base::Buffer& payload) {
const rtc::Buffer& payload) {
uint32 expected_ssrc =
(data_channel_type_ == cricket::DCT_RTP) ? receive_ssrc_ : config_.id;
if (params.ssrc != expected_ssrc) {
@ -325,7 +325,7 @@ void DataChannel::OnDataReceived(cricket::DataChannel* channel,
waiting_for_open_ack_ = false;
bool binary = (params.type == cricket::DMT_BINARY);
talk_base::scoped_ptr<DataBuffer> buffer(new DataBuffer(payload, binary));
rtc::scoped_ptr<DataBuffer> buffer(new DataBuffer(payload, binary));
if (was_ever_writable_ && observer_) {
observer_->OnMessage(*buffer.get());
} else {
@ -355,7 +355,7 @@ void DataChannel::OnChannelReady(bool writable) {
was_ever_writable_ = true;
if (data_channel_type_ == cricket::DCT_SCTP) {
talk_base::Buffer payload;
rtc::Buffer payload;
if (config_.open_handshake_role == InternalDataChannelInit::kOpener) {
WriteDataChannelOpenMessage(label_, config_, &payload);
@ -452,7 +452,7 @@ void DataChannel::DeliverQueuedReceivedData() {
}
while (!queued_received_data_.Empty()) {
talk_base::scoped_ptr<DataBuffer> buffer(queued_received_data_.Front());
rtc::scoped_ptr<DataBuffer> buffer(queued_received_data_.Front());
observer_->OnMessage(*buffer);
queued_received_data_.Pop();
}
@ -465,7 +465,7 @@ void DataChannel::SendQueuedDataMessages() {
packet_buffer.Swap(&queued_send_data_);
while (!packet_buffer.Empty()) {
talk_base::scoped_ptr<DataBuffer> buffer(packet_buffer.Front());
rtc::scoped_ptr<DataBuffer> buffer(packet_buffer.Front());
SendDataMessage(*buffer);
packet_buffer.Pop();
}
@ -520,17 +520,17 @@ void DataChannel::SendQueuedControlMessages() {
control_packets.Swap(&queued_control_data_);
while (!control_packets.Empty()) {
talk_base::scoped_ptr<DataBuffer> buf(control_packets.Front());
rtc::scoped_ptr<DataBuffer> buf(control_packets.Front());
SendControlMessage(buf->data);
control_packets.Pop();
}
}
void DataChannel::QueueControlMessage(const talk_base::Buffer& buffer) {
void DataChannel::QueueControlMessage(const rtc::Buffer& buffer) {
queued_control_data_.Push(new DataBuffer(buffer, true));
}
bool DataChannel::SendControlMessage(const talk_base::Buffer& buffer) {
bool DataChannel::SendControlMessage(const rtc::Buffer& buffer) {
bool is_open_message =
(config_.open_handshake_role == InternalDataChannelInit::kOpener);

View File

@ -33,9 +33,9 @@
#include "talk/app/webrtc/datachannelinterface.h"
#include "talk/app/webrtc/proxy.h"
#include "talk/base/messagehandler.h"
#include "talk/base/scoped_ref_ptr.h"
#include "talk/base/sigslot.h"
#include "webrtc/base/messagehandler.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/base/sigslot.h"
#include "talk/media/base/mediachannel.h"
#include "talk/session/media/channel.h"
@ -47,7 +47,7 @@ class DataChannelProviderInterface {
public:
// Sends the data to the transport.
virtual bool SendData(const cricket::SendDataParams& params,
const talk_base::Buffer& payload,
const rtc::Buffer& payload,
cricket::SendDataResult* result) = 0;
// Connects to the transport signals.
virtual bool ConnectDataChannel(DataChannel* data_channel) = 0;
@ -100,9 +100,9 @@ struct InternalDataChannelInit : public DataChannelInit {
// SSRC==0.
class DataChannel : public DataChannelInterface,
public sigslot::has_slots<>,
public talk_base::MessageHandler {
public rtc::MessageHandler {
public:
static talk_base::scoped_refptr<DataChannel> Create(
static rtc::scoped_refptr<DataChannel> Create(
DataChannelProviderInterface* provider,
cricket::DataChannelType dct,
const std::string& label,
@ -128,8 +128,8 @@ class DataChannel : public DataChannelInterface,
virtual DataState state() const { return state_; }
virtual bool Send(const DataBuffer& buffer);
// talk_base::MessageHandler override.
virtual void OnMessage(talk_base::Message* msg);
// rtc::MessageHandler override.
virtual void OnMessage(rtc::Message* msg);
// Called if the underlying data engine is closing.
void OnDataEngineClose();
@ -142,7 +142,7 @@ class DataChannel : public DataChannelInterface,
// Sigslots from cricket::DataChannel
void OnDataReceived(cricket::DataChannel* channel,
const cricket::ReceiveDataParams& params,
const talk_base::Buffer& payload);
const rtc::Buffer& payload);
// The remote peer request that this channel should be closed.
void RemotePeerRequestClose();
@ -217,8 +217,8 @@ class DataChannel : public DataChannelInterface,
bool QueueSendDataMessage(const DataBuffer& buffer);
void SendQueuedControlMessages();
void QueueControlMessage(const talk_base::Buffer& buffer);
bool SendControlMessage(const talk_base::Buffer& buffer);
void QueueControlMessage(const rtc::Buffer& buffer);
bool SendControlMessage(const rtc::Buffer& buffer);
std::string label_;
InternalDataChannelInit config_;
@ -242,7 +242,7 @@ class DataChannel : public DataChannelInterface,
class DataChannelFactory {
public:
virtual talk_base::scoped_refptr<DataChannel> CreateDataChannel(
virtual rtc::scoped_refptr<DataChannel> CreateDataChannel(
const std::string& label,
const InternalDataChannelInit* config) = 0;

View File

@ -28,7 +28,7 @@
#include "talk/app/webrtc/datachannel.h"
#include "talk/app/webrtc/sctputils.h"
#include "talk/app/webrtc/test/fakedatachannelprovider.h"
#include "talk/base/gunit.h"
#include "webrtc/base/gunit.h"
using webrtc::DataChannel;
@ -86,14 +86,14 @@ class SctpDataChannelTest : public testing::Test {
webrtc::InternalDataChannelInit init_;
FakeDataChannelProvider provider_;
talk_base::scoped_ptr<FakeDataChannelObserver> observer_;
talk_base::scoped_refptr<DataChannel> webrtc_data_channel_;
rtc::scoped_ptr<FakeDataChannelObserver> observer_;
rtc::scoped_refptr<DataChannel> webrtc_data_channel_;
};
// Verifies that the data channel is connected to the transport after creation.
TEST_F(SctpDataChannelTest, ConnectedToTransportOnCreated) {
provider_.set_transport_available(true);
talk_base::scoped_refptr<DataChannel> dc = DataChannel::Create(
rtc::scoped_refptr<DataChannel> dc = DataChannel::Create(
&provider_, cricket::DCT_SCTP, "test1", init_);
EXPECT_TRUE(provider_.IsConnected(dc.get()));
@ -190,7 +190,7 @@ TEST_F(SctpDataChannelTest, LateCreatedChannelTransitionToOpen) {
SetChannelReady();
webrtc::InternalDataChannelInit init;
init.id = 1;
talk_base::scoped_refptr<DataChannel> dc = DataChannel::Create(
rtc::scoped_refptr<DataChannel> dc = DataChannel::Create(
&provider_, cricket::DCT_SCTP, "test1", init);
EXPECT_EQ(webrtc::DataChannelInterface::kConnecting, dc->state());
EXPECT_TRUE_WAIT(webrtc::DataChannelInterface::kOpen == dc->state(),
@ -204,7 +204,7 @@ TEST_F(SctpDataChannelTest, SendUnorderedAfterReceivesOpenAck) {
webrtc::InternalDataChannelInit init;
init.id = 1;
init.ordered = false;
talk_base::scoped_refptr<DataChannel> dc = DataChannel::Create(
rtc::scoped_refptr<DataChannel> dc = DataChannel::Create(
&provider_, cricket::DCT_SCTP, "test1", init);
EXPECT_EQ_WAIT(webrtc::DataChannelInterface::kOpen, dc->state(), 1000);
@ -218,7 +218,7 @@ TEST_F(SctpDataChannelTest, SendUnorderedAfterReceivesOpenAck) {
cricket::ReceiveDataParams params;
params.ssrc = init.id;
params.type = cricket::DMT_CONTROL;
talk_base::Buffer payload;
rtc::Buffer payload;
webrtc::WriteDataChannelOpenAckMessage(&payload);
dc->OnDataReceived(NULL, params, payload);
@ -234,7 +234,7 @@ TEST_F(SctpDataChannelTest, SendUnorderedAfterReceiveData) {
webrtc::InternalDataChannelInit init;
init.id = 1;
init.ordered = false;
talk_base::scoped_refptr<DataChannel> dc = DataChannel::Create(
rtc::scoped_refptr<DataChannel> dc = DataChannel::Create(
&provider_, cricket::DCT_SCTP, "test1", init);
EXPECT_EQ_WAIT(webrtc::DataChannelInterface::kOpen, dc->state(), 1000);
@ -299,7 +299,7 @@ TEST_F(SctpDataChannelTest, NoMsgSentIfNegotiatedAndNotFromOpenMsg) {
config.open_handshake_role = webrtc::InternalDataChannelInit::kNone;
SetChannelReady();
talk_base::scoped_refptr<DataChannel> dc = DataChannel::Create(
rtc::scoped_refptr<DataChannel> dc = DataChannel::Create(
&provider_, cricket::DCT_SCTP, "test1", config);
EXPECT_EQ_WAIT(webrtc::DataChannelInterface::kOpen, dc->state(), 1000);
@ -315,7 +315,7 @@ TEST_F(SctpDataChannelTest, OpenAckSentIfCreatedFromOpenMessage) {
config.open_handshake_role = webrtc::InternalDataChannelInit::kAcker;
SetChannelReady();
talk_base::scoped_refptr<DataChannel> dc = DataChannel::Create(
rtc::scoped_refptr<DataChannel> dc = DataChannel::Create(
&provider_, cricket::DCT_SCTP, "test1", config);
EXPECT_EQ_WAIT(webrtc::DataChannelInterface::kOpen, dc->state(), 1000);
@ -342,7 +342,7 @@ TEST_F(SctpDataChannelTest, ClosedWhenSendBufferFull) {
SetChannelReady();
const size_t buffer_size = 1024;
talk_base::Buffer buffer;
rtc::Buffer buffer;
buffer.SetLength(buffer_size);
memset(buffer.data(), 0, buffer_size);
@ -396,7 +396,7 @@ TEST_F(SctpDataChannelTest, RemotePeerRequestClose) {
TEST_F(SctpDataChannelTest, ClosedWhenReceivedBufferFull) {
SetChannelReady();
const size_t buffer_size = 1024;
talk_base::Buffer buffer;
rtc::Buffer buffer;
buffer.SetLength(buffer_size);
memset(buffer.data(), 0, buffer_size);

View File

@ -33,9 +33,9 @@
#include <string>
#include "talk/base/basictypes.h"
#include "talk/base/buffer.h"
#include "talk/base/refcount.h"
#include "webrtc/base/basictypes.h"
#include "webrtc/base/buffer.h"
#include "webrtc/base/refcount.h"
namespace webrtc {
@ -66,7 +66,7 @@ struct DataChannelInit {
};
struct DataBuffer {
DataBuffer(const talk_base::Buffer& data, bool binary)
DataBuffer(const rtc::Buffer& data, bool binary)
: data(data),
binary(binary) {
}
@ -77,7 +77,7 @@ struct DataBuffer {
}
size_t size() const { return data.length(); }
talk_base::Buffer data;
rtc::Buffer data;
// Indicates if the received data contains UTF-8 or binary data.
// Note that the upper layers are left to verify the UTF-8 encoding.
// TODO(jiayl): prefer to use an enum instead of a bool.
@ -95,7 +95,7 @@ class DataChannelObserver {
virtual ~DataChannelObserver() {}
};
class DataChannelInterface : public talk_base::RefCountInterface {
class DataChannelInterface : public rtc::RefCountInterface {
public:
// Keep in sync with DataChannel.java:State and
// RTCDataChannel.h:RTCDataChannelState.

View File

@ -31,8 +31,8 @@
#include <string>
#include "talk/base/logging.h"
#include "talk/base/thread.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/thread.h"
namespace webrtc {
@ -75,21 +75,21 @@ bool GetDtmfCode(char tone, int* code) {
return true;
}
talk_base::scoped_refptr<DtmfSender> DtmfSender::Create(
rtc::scoped_refptr<DtmfSender> DtmfSender::Create(
AudioTrackInterface* track,
talk_base::Thread* signaling_thread,
rtc::Thread* signaling_thread,
DtmfProviderInterface* provider) {
if (!track || !signaling_thread) {
return NULL;
}
talk_base::scoped_refptr<DtmfSender> dtmf_sender(
new talk_base::RefCountedObject<DtmfSender>(track, signaling_thread,
rtc::scoped_refptr<DtmfSender> dtmf_sender(
new rtc::RefCountedObject<DtmfSender>(track, signaling_thread,
provider));
return dtmf_sender;
}
DtmfSender::DtmfSender(AudioTrackInterface* track,
talk_base::Thread* signaling_thread,
rtc::Thread* signaling_thread,
DtmfProviderInterface* provider)
: track_(track),
observer_(NULL),
@ -176,7 +176,7 @@ int DtmfSender::inter_tone_gap() const {
return inter_tone_gap_;
}
void DtmfSender::OnMessage(talk_base::Message* msg) {
void DtmfSender::OnMessage(rtc::Message* msg) {
switch (msg->message_id) {
case MSG_DO_INSERT_DTMF: {
DoInsertDtmf();

View File

@ -33,15 +33,15 @@
#include "talk/app/webrtc/dtmfsenderinterface.h"
#include "talk/app/webrtc/mediastreaminterface.h"
#include "talk/app/webrtc/proxy.h"
#include "talk/base/common.h"
#include "talk/base/messagehandler.h"
#include "talk/base/refcount.h"
#include "webrtc/base/common.h"
#include "webrtc/base/messagehandler.h"
#include "webrtc/base/refcount.h"
// DtmfSender is the native implementation of the RTCDTMFSender defined by
// the WebRTC W3C Editor's Draft.
// http://dev.w3.org/2011/webrtc/editor/webrtc.html
namespace talk_base {
namespace rtc {
class Thread;
}
@ -70,11 +70,11 @@ class DtmfProviderInterface {
class DtmfSender
: public DtmfSenderInterface,
public sigslot::has_slots<>,
public talk_base::MessageHandler {
public rtc::MessageHandler {
public:
static talk_base::scoped_refptr<DtmfSender> Create(
static rtc::scoped_refptr<DtmfSender> Create(
AudioTrackInterface* track,
talk_base::Thread* signaling_thread,
rtc::Thread* signaling_thread,
DtmfProviderInterface* provider);
// Implements DtmfSenderInterface.
@ -90,7 +90,7 @@ class DtmfSender
protected:
DtmfSender(AudioTrackInterface* track,
talk_base::Thread* signaling_thread,
rtc::Thread* signaling_thread,
DtmfProviderInterface* provider);
virtual ~DtmfSender();
@ -98,7 +98,7 @@ class DtmfSender
DtmfSender();
// Implements MessageHandler.
virtual void OnMessage(talk_base::Message* msg);
virtual void OnMessage(rtc::Message* msg);
// The DTMF sending task.
void DoInsertDtmf();
@ -107,9 +107,9 @@ class DtmfSender
void StopSending();
talk_base::scoped_refptr<AudioTrackInterface> track_;
rtc::scoped_refptr<AudioTrackInterface> track_;
DtmfSenderObserverInterface* observer_;
talk_base::Thread* signaling_thread_;
rtc::Thread* signaling_thread_;
DtmfProviderInterface* provider_;
std::string tones_;
int duration_;

View File

@ -32,9 +32,9 @@
#include <vector>
#include "talk/app/webrtc/audiotrack.h"
#include "talk/base/gunit.h"
#include "talk/base/logging.h"
#include "talk/base/timeutils.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/timeutils.h"
using webrtc::AudioTrackInterface;
using webrtc::AudioTrack;
@ -97,12 +97,12 @@ class FakeDtmfProvider : public DtmfProviderInterface {
virtual bool InsertDtmf(const std::string& track_label,
int code, int duration) OVERRIDE {
int gap = 0;
// TODO(ronghuawu): Make the timer (basically the talk_base::TimeNanos)
// TODO(ronghuawu): Make the timer (basically the rtc::TimeNanos)
// mockable and use a fake timer in the unit tests.
if (last_insert_dtmf_call_ > 0) {
gap = static_cast<int>(talk_base::Time() - last_insert_dtmf_call_);
gap = static_cast<int>(rtc::Time() - last_insert_dtmf_call_);
}
last_insert_dtmf_call_ = talk_base::Time();
last_insert_dtmf_call_ = rtc::Time();
LOG(LS_VERBOSE) << "FakeDtmfProvider::InsertDtmf code=" << code
<< " duration=" << duration
@ -139,10 +139,10 @@ class DtmfSenderTest : public testing::Test {
protected:
DtmfSenderTest()
: track_(AudioTrack::Create(kTestAudioLabel, NULL)),
observer_(new talk_base::RefCountedObject<FakeDtmfObserver>()),
observer_(new rtc::RefCountedObject<FakeDtmfObserver>()),
provider_(new FakeDtmfProvider()) {
provider_->AddCanInsertDtmfTrack(kTestAudioLabel);
dtmf_ = DtmfSender::Create(track_, talk_base::Thread::Current(),
dtmf_ = DtmfSender::Create(track_, rtc::Thread::Current(),
provider_.get());
dtmf_->RegisterObserver(observer_.get());
}
@ -229,10 +229,10 @@ class DtmfSenderTest : public testing::Test {
}
}
talk_base::scoped_refptr<AudioTrackInterface> track_;
talk_base::scoped_ptr<FakeDtmfObserver> observer_;
talk_base::scoped_ptr<FakeDtmfProvider> provider_;
talk_base::scoped_refptr<DtmfSender> dtmf_;
rtc::scoped_refptr<AudioTrackInterface> track_;
rtc::scoped_ptr<FakeDtmfObserver> observer_;
rtc::scoped_ptr<FakeDtmfProvider> provider_;
rtc::scoped_refptr<DtmfSender> dtmf_;
};
TEST_F(DtmfSenderTest, CanInsertDtmf) {

View File

@ -31,8 +31,8 @@
#include <string>
#include "talk/app/webrtc/mediastreaminterface.h"
#include "talk/base/common.h"
#include "talk/base/refcount.h"
#include "webrtc/base/common.h"
#include "webrtc/base/refcount.h"
// This file contains interfaces for DtmfSender.
@ -53,7 +53,7 @@ class DtmfSenderObserverInterface {
// The interface of native implementation of the RTCDTMFSender defined by the
// WebRTC W3C Editor's Draft.
class DtmfSenderInterface : public talk_base::RefCountInterface {
class DtmfSenderInterface : public rtc::RefCountInterface {
public:
virtual void RegisterObserver(DtmfSenderObserverInterface* observer) = 0;
virtual void UnregisterObserver() = 0;

View File

@ -39,8 +39,8 @@ namespace webrtc {
class FakePortAllocatorFactory : public PortAllocatorFactoryInterface {
public:
static FakePortAllocatorFactory* Create() {
talk_base::RefCountedObject<FakePortAllocatorFactory>* allocator =
new talk_base::RefCountedObject<FakePortAllocatorFactory>();
rtc::RefCountedObject<FakePortAllocatorFactory>* allocator =
new rtc::RefCountedObject<FakePortAllocatorFactory>();
return allocator;
}
@ -49,7 +49,7 @@ class FakePortAllocatorFactory : public PortAllocatorFactoryInterface {
const std::vector<TurnConfiguration>& turn_configurations) {
stun_configs_ = stun_configurations;
turn_configs_ = turn_configurations;
return new cricket::FakePortAllocator(talk_base::Thread::Current(), NULL);
return new cricket::FakePortAllocator(rtc::Thread::Current(), NULL);
}
const std::vector<StunConfiguration>& stun_configs() const {

View File

@ -66,10 +66,10 @@
#include "talk/app/webrtc/mediaconstraintsinterface.h"
#include "talk/app/webrtc/peerconnectioninterface.h"
#include "talk/app/webrtc/videosourceinterface.h"
#include "talk/base/bind.h"
#include "talk/base/logging.h"
#include "talk/base/messagequeue.h"
#include "talk/base/ssladapter.h"
#include "webrtc/base/bind.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/messagequeue.h"
#include "webrtc/base/ssladapter.h"
#include "talk/media/base/videocapturer.h"
#include "talk/media/base/videorenderer.h"
#include "talk/media/devices/videorendererfactory.h"
@ -98,10 +98,10 @@ using webrtc::VideoCodec;
#endif
using icu::UnicodeString;
using talk_base::Bind;
using talk_base::Thread;
using talk_base::ThreadManager;
using talk_base::scoped_ptr;
using rtc::Bind;
using rtc::Thread;
using rtc::ThreadManager;
using rtc::scoped_ptr;
using webrtc::AudioSourceInterface;
using webrtc::AudioTrackInterface;
using webrtc::AudioTrackVector;
@ -1177,7 +1177,7 @@ enum { kMediaCodecPollMs = 10 };
// MediaCodecVideoEncoder is created, operated, and destroyed on a single
// thread, currently the libjingle Worker thread.
class MediaCodecVideoEncoder : public webrtc::VideoEncoder,
public talk_base::MessageHandler {
public rtc::MessageHandler {
public:
virtual ~MediaCodecVideoEncoder();
explicit MediaCodecVideoEncoder(JNIEnv* jni);
@ -1198,8 +1198,8 @@ class MediaCodecVideoEncoder : public webrtc::VideoEncoder,
int /* rtt */) OVERRIDE;
virtual int32_t SetRates(uint32_t new_bit_rate, uint32_t frame_rate) OVERRIDE;
// talk_base::MessageHandler implementation.
virtual void OnMessage(talk_base::Message* msg) OVERRIDE;
// rtc::MessageHandler implementation.
virtual void OnMessage(rtc::Message* msg) OVERRIDE;
private:
// CHECK-fail if not running on |codec_thread_|.
@ -1401,7 +1401,7 @@ int32_t MediaCodecVideoEncoder::SetRates(uint32_t new_bit_rate,
frame_rate));
}
void MediaCodecVideoEncoder::OnMessage(talk_base::Message* msg) {
void MediaCodecVideoEncoder::OnMessage(rtc::Message* msg) {
JNIEnv* jni = AttachCurrentThreadIfNeeded();
ScopedLocalRefFrame local_ref_frame(jni);
@ -1639,7 +1639,7 @@ int32_t MediaCodecVideoEncoder::SetRatesOnCodecThread(uint32_t new_bit_rate,
}
void MediaCodecVideoEncoder::ResetParameters(JNIEnv* jni) {
talk_base::MessageQueueManager::Clear(this);
rtc::MessageQueueManager::Clear(this);
width_ = 0;
height_ = 0;
yuv_size_ = 0;
@ -1818,7 +1818,7 @@ void MediaCodecVideoEncoderFactory::DestroyVideoEncoder(
}
class MediaCodecVideoDecoder : public webrtc::VideoDecoder,
public talk_base::MessageHandler {
public rtc::MessageHandler {
public:
explicit MediaCodecVideoDecoder(JNIEnv* jni);
virtual ~MediaCodecVideoDecoder();
@ -1838,8 +1838,8 @@ class MediaCodecVideoDecoder : public webrtc::VideoDecoder,
virtual int32_t Release() OVERRIDE;
virtual int32_t Reset() OVERRIDE;
// talk_base::MessageHandler implementation.
virtual void OnMessage(talk_base::Message* msg) OVERRIDE;
// rtc::MessageHandler implementation.
virtual void OnMessage(rtc::Message* msg) OVERRIDE;
private:
// CHECK-fail if not running on |codec_thread_|.
@ -2196,7 +2196,7 @@ int32_t MediaCodecVideoDecoder::Reset() {
return InitDecode(&codec_, 1);
}
void MediaCodecVideoDecoder::OnMessage(talk_base::Message* msg) {
void MediaCodecVideoDecoder::OnMessage(rtc::Message* msg) {
}
class MediaCodecVideoDecoderFactory
@ -2256,7 +2256,7 @@ extern "C" jint JNIEXPORT JNICALL JNI_OnLoad(JavaVM *jvm, void *reserved) {
CHECK(!pthread_once(&g_jni_ptr_once, &CreateJNIPtrKey), "pthread_once");
CHECK(talk_base::InitializeSSL(), "Failed to InitializeSSL()");
CHECK(rtc::InitializeSSL(), "Failed to InitializeSSL()");
JNIEnv* jni;
if (jvm->GetEnv(reinterpret_cast<void**>(&jni), JNI_VERSION_1_6) != JNI_OK)
@ -2270,7 +2270,7 @@ extern "C" void JNIEXPORT JNICALL JNI_OnUnLoad(JavaVM *jvm, void *reserved) {
g_class_reference_holder->FreeReferences(AttachCurrentThreadIfNeeded());
delete g_class_reference_holder;
g_class_reference_holder = NULL;
CHECK(talk_base::CleanupSSL(), "Failed to CleanupSSL()");
CHECK(rtc::CleanupSSL(), "Failed to CleanupSSL()");
g_jvm = NULL;
}
@ -2319,7 +2319,7 @@ JOW(jboolean, DataChannel_sendNative)(JNIEnv* jni, jobject j_dc,
jbyteArray data, jboolean binary) {
jbyte* bytes = jni->GetByteArrayElements(data, NULL);
bool ret = ExtractNativeDC(jni, j_dc)->Send(DataBuffer(
talk_base::Buffer(bytes, jni->GetArrayLength(data)),
rtc::Buffer(bytes, jni->GetArrayLength(data)),
binary));
jni->ReleaseByteArrayElements(data, bytes, JNI_ABORT);
return ret;
@ -2348,7 +2348,7 @@ JOW(void, Logging_nativeEnableTracing)(
}
#endif
}
talk_base::LogMessage::LogToDebug(nativeSeverity);
rtc::LogMessage::LogToDebug(nativeSeverity);
}
JOW(void, PeerConnection_freePeerConnection)(JNIEnv*, jclass, jlong j_p) {
@ -2458,9 +2458,9 @@ JOW(jlong, PeerConnectionFactory_nativeCreatePeerConnectionFactory)(
// talk/ assumes pretty widely that the current Thread is ThreadManager'd, but
// ThreadManager only WrapCurrentThread()s the thread where it is first
// created. Since the semantics around when auto-wrapping happens in
// talk/base/ are convoluted, we simply wrap here to avoid having to think
// webrtc/base/ are convoluted, we simply wrap here to avoid having to think
// about ramifications of auto-wrapping there.
talk_base::ThreadManager::Instance()->WrapCurrentThread();
rtc::ThreadManager::Instance()->WrapCurrentThread();
webrtc::Trace::CreateTrace();
Thread* worker_thread = new Thread();
worker_thread->SetName("worker_thread", NULL);
@ -2474,7 +2474,7 @@ JOW(jlong, PeerConnectionFactory_nativeCreatePeerConnectionFactory)(
encoder_factory.reset(new MediaCodecVideoEncoderFactory());
decoder_factory.reset(new MediaCodecVideoDecoderFactory());
#endif
talk_base::scoped_refptr<PeerConnectionFactoryInterface> factory(
rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
webrtc::CreatePeerConnectionFactory(worker_thread,
signaling_thread,
NULL,
@ -2496,9 +2496,9 @@ static PeerConnectionFactoryInterface* factoryFromJava(jlong j_p) {
JOW(jlong, PeerConnectionFactory_nativeCreateLocalMediaStream)(
JNIEnv* jni, jclass, jlong native_factory, jstring label) {
talk_base::scoped_refptr<PeerConnectionFactoryInterface> factory(
rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
factoryFromJava(native_factory));
talk_base::scoped_refptr<MediaStreamInterface> stream(
rtc::scoped_refptr<MediaStreamInterface> stream(
factory->CreateLocalMediaStream(JavaToStdString(jni, label)));
return (jlong)stream.release();
}
@ -2508,9 +2508,9 @@ JOW(jlong, PeerConnectionFactory_nativeCreateVideoSource)(
jobject j_constraints) {
scoped_ptr<ConstraintsWrapper> constraints(
new ConstraintsWrapper(jni, j_constraints));
talk_base::scoped_refptr<PeerConnectionFactoryInterface> factory(
rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
factoryFromJava(native_factory));
talk_base::scoped_refptr<VideoSourceInterface> source(
rtc::scoped_refptr<VideoSourceInterface> source(
factory->CreateVideoSource(
reinterpret_cast<cricket::VideoCapturer*>(native_capturer),
constraints.get()));
@ -2520,9 +2520,9 @@ JOW(jlong, PeerConnectionFactory_nativeCreateVideoSource)(
JOW(jlong, PeerConnectionFactory_nativeCreateVideoTrack)(
JNIEnv* jni, jclass, jlong native_factory, jstring id,
jlong native_source) {
talk_base::scoped_refptr<PeerConnectionFactoryInterface> factory(
rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
factoryFromJava(native_factory));
talk_base::scoped_refptr<VideoTrackInterface> track(
rtc::scoped_refptr<VideoTrackInterface> track(
factory->CreateVideoTrack(
JavaToStdString(jni, id),
reinterpret_cast<VideoSourceInterface*>(native_source)));
@ -2533,9 +2533,9 @@ JOW(jlong, PeerConnectionFactory_nativeCreateAudioSource)(
JNIEnv* jni, jclass, jlong native_factory, jobject j_constraints) {
scoped_ptr<ConstraintsWrapper> constraints(
new ConstraintsWrapper(jni, j_constraints));
talk_base::scoped_refptr<PeerConnectionFactoryInterface> factory(
rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
factoryFromJava(native_factory));
talk_base::scoped_refptr<AudioSourceInterface> source(
rtc::scoped_refptr<AudioSourceInterface> source(
factory->CreateAudioSource(constraints.get()));
return (jlong)source.release();
}
@ -2543,9 +2543,9 @@ JOW(jlong, PeerConnectionFactory_nativeCreateAudioSource)(
JOW(jlong, PeerConnectionFactory_nativeCreateAudioTrack)(
JNIEnv* jni, jclass, jlong native_factory, jstring id,
jlong native_source) {
talk_base::scoped_refptr<PeerConnectionFactoryInterface> factory(
rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
factoryFromJava(native_factory));
talk_base::scoped_refptr<AudioTrackInterface> track(factory->CreateAudioTrack(
rtc::scoped_refptr<AudioTrackInterface> track(factory->CreateAudioTrack(
JavaToStdString(jni, id),
reinterpret_cast<AudioSourceInterface*>(native_source)));
return (jlong)track.release();
@ -2592,24 +2592,24 @@ static void JavaIceServersToJsepIceServers(
JOW(jlong, PeerConnectionFactory_nativeCreatePeerConnection)(
JNIEnv *jni, jclass, jlong factory, jobject j_ice_servers,
jobject j_constraints, jlong observer_p) {
talk_base::scoped_refptr<PeerConnectionFactoryInterface> f(
rtc::scoped_refptr<PeerConnectionFactoryInterface> f(
reinterpret_cast<PeerConnectionFactoryInterface*>(
factoryFromJava(factory)));
PeerConnectionInterface::IceServers servers;
JavaIceServersToJsepIceServers(jni, j_ice_servers, &servers);
PCOJava* observer = reinterpret_cast<PCOJava*>(observer_p);
observer->SetConstraints(new ConstraintsWrapper(jni, j_constraints));
talk_base::scoped_refptr<PeerConnectionInterface> pc(f->CreatePeerConnection(
rtc::scoped_refptr<PeerConnectionInterface> pc(f->CreatePeerConnection(
servers, observer->constraints(), NULL, NULL, observer));
return (jlong)pc.release();
}
static talk_base::scoped_refptr<PeerConnectionInterface> ExtractNativePC(
static rtc::scoped_refptr<PeerConnectionInterface> ExtractNativePC(
JNIEnv* jni, jobject j_pc) {
jfieldID native_pc_id = GetFieldID(jni,
GetObjectClass(jni, j_pc), "nativePeerConnection", "J");
jlong j_p = GetLongField(jni, j_pc, native_pc_id);
return talk_base::scoped_refptr<PeerConnectionInterface>(
return rtc::scoped_refptr<PeerConnectionInterface>(
reinterpret_cast<PeerConnectionInterface*>(j_p));
}
@ -2628,7 +2628,7 @@ JOW(jobject, PeerConnection_getRemoteDescription)(JNIEnv* jni, jobject j_pc) {
JOW(jobject, PeerConnection_createDataChannel)(
JNIEnv* jni, jobject j_pc, jstring j_label, jobject j_init) {
DataChannelInit init = JavaDataChannelInitToNative(jni, j_init);
talk_base::scoped_refptr<DataChannelInterface> channel(
rtc::scoped_refptr<DataChannelInterface> channel(
ExtractNativePC(jni, j_pc)->CreateDataChannel(
JavaToStdString(jni, j_label), &init));
// Mustn't pass channel.get() directly through NewObject to avoid reading its
@ -2652,8 +2652,8 @@ JOW(void, PeerConnection_createOffer)(
JNIEnv* jni, jobject j_pc, jobject j_observer, jobject j_constraints) {
ConstraintsWrapper* constraints =
new ConstraintsWrapper(jni, j_constraints);
talk_base::scoped_refptr<CreateSdpObserverWrapper> observer(
new talk_base::RefCountedObject<CreateSdpObserverWrapper>(
rtc::scoped_refptr<CreateSdpObserverWrapper> observer(
new rtc::RefCountedObject<CreateSdpObserverWrapper>(
jni, j_observer, constraints));
ExtractNativePC(jni, j_pc)->CreateOffer(observer, constraints);
}
@ -2662,8 +2662,8 @@ JOW(void, PeerConnection_createAnswer)(
JNIEnv* jni, jobject j_pc, jobject j_observer, jobject j_constraints) {
ConstraintsWrapper* constraints =
new ConstraintsWrapper(jni, j_constraints);
talk_base::scoped_refptr<CreateSdpObserverWrapper> observer(
new talk_base::RefCountedObject<CreateSdpObserverWrapper>(
rtc::scoped_refptr<CreateSdpObserverWrapper> observer(
new rtc::RefCountedObject<CreateSdpObserverWrapper>(
jni, j_observer, constraints));
ExtractNativePC(jni, j_pc)->CreateAnswer(observer, constraints);
}
@ -2695,8 +2695,8 @@ static SessionDescriptionInterface* JavaSdpToNativeSdp(
JOW(void, PeerConnection_setLocalDescription)(
JNIEnv* jni, jobject j_pc,
jobject j_observer, jobject j_sdp) {
talk_base::scoped_refptr<SetSdpObserverWrapper> observer(
new talk_base::RefCountedObject<SetSdpObserverWrapper>(
rtc::scoped_refptr<SetSdpObserverWrapper> observer(
new rtc::RefCountedObject<SetSdpObserverWrapper>(
jni, j_observer, reinterpret_cast<ConstraintsWrapper*>(NULL)));
ExtractNativePC(jni, j_pc)->SetLocalDescription(
observer, JavaSdpToNativeSdp(jni, j_sdp));
@ -2705,8 +2705,8 @@ JOW(void, PeerConnection_setLocalDescription)(
JOW(void, PeerConnection_setRemoteDescription)(
JNIEnv* jni, jobject j_pc,
jobject j_observer, jobject j_sdp) {
talk_base::scoped_refptr<SetSdpObserverWrapper> observer(
new talk_base::RefCountedObject<SetSdpObserverWrapper>(
rtc::scoped_refptr<SetSdpObserverWrapper> observer(
new rtc::RefCountedObject<SetSdpObserverWrapper>(
jni, j_observer, reinterpret_cast<ConstraintsWrapper*>(NULL)));
ExtractNativePC(jni, j_pc)->SetRemoteDescription(
observer, JavaSdpToNativeSdp(jni, j_sdp));
@ -2748,8 +2748,8 @@ JOW(void, PeerConnection_nativeRemoveLocalStream)(
JOW(bool, PeerConnection_nativeGetStats)(
JNIEnv* jni, jobject j_pc, jobject j_observer, jlong native_track) {
talk_base::scoped_refptr<StatsObserverWrapper> observer(
new talk_base::RefCountedObject<StatsObserverWrapper>(jni, j_observer));
rtc::scoped_refptr<StatsObserverWrapper> observer(
new rtc::RefCountedObject<StatsObserverWrapper>(jni, j_observer));
return ExtractNativePC(jni, j_pc)->GetStats(
observer,
reinterpret_cast<MediaStreamTrackInterface*>(native_track),
@ -2780,7 +2780,7 @@ JOW(void, PeerConnection_close)(JNIEnv* jni, jobject j_pc) {
}
JOW(jobject, MediaSource_nativeState)(JNIEnv* jni, jclass, jlong j_p) {
talk_base::scoped_refptr<MediaSourceInterface> p(
rtc::scoped_refptr<MediaSourceInterface> p(
reinterpret_cast<MediaSourceInterface*>(j_p));
return JavaEnumFromIndex(jni, "MediaSource$State", p->state());
}

View File

@ -59,7 +59,7 @@ public class Logging {
}
};
// Keep in sync with talk/base/logging.h:LoggingSeverity.
// Keep in sync with webrtc/base/logging.h:LoggingSeverity.
public enum Severity {
LS_SENSITIVE, LS_VERBOSE, LS_INFO, LS_WARNING, LS_ERROR,
};

View File

@ -33,8 +33,8 @@
#include <string>
#include <vector>
#include "talk/base/basictypes.h"
#include "talk/base/refcount.h"
#include "webrtc/base/basictypes.h"
#include "webrtc/base/refcount.h"
namespace cricket {
class SessionDescription;
@ -138,7 +138,7 @@ SessionDescriptionInterface* CreateSessionDescription(const std::string& type,
SdpParseError* error);
// Jsep CreateOffer and CreateAnswer callback interface.
class CreateSessionDescriptionObserver : public talk_base::RefCountInterface {
class CreateSessionDescriptionObserver : public rtc::RefCountInterface {
public:
// The implementation of the CreateSessionDescriptionObserver takes
// the ownership of the |desc|.
@ -150,7 +150,7 @@ class CreateSessionDescriptionObserver : public talk_base::RefCountInterface {
};
// Jsep SetLocalDescription and SetRemoteDescription callback interface.
class SetSessionDescriptionObserver : public talk_base::RefCountInterface {
class SetSessionDescriptionObserver : public rtc::RefCountInterface {
public:
virtual void OnSuccess() = 0;
virtual void OnFailure(const std::string& error) = 0;

View File

@ -30,7 +30,7 @@
#include <vector>
#include "talk/app/webrtc/webrtcsdp.h"
#include "talk/base/stringencode.h"
#include "webrtc/base/stringencode.h"
namespace webrtc {

View File

@ -33,7 +33,7 @@
#include <string>
#include "talk/app/webrtc/jsep.h"
#include "talk/base/constructormagic.h"
#include "webrtc/base/constructormagic.h"
#include "talk/p2p/base/candidate.h"
namespace webrtc {

View File

@ -27,10 +27,10 @@
#include "talk/app/webrtc/jsepsessiondescription.h"
#include "talk/app/webrtc/webrtcsdp.h"
#include "talk/base/stringencode.h"
#include "webrtc/base/stringencode.h"
#include "talk/session/media/mediasession.h"
using talk_base::scoped_ptr;
using rtc::scoped_ptr;
using cricket::SessionDescription;
namespace webrtc {

View File

@ -35,7 +35,7 @@
#include "talk/app/webrtc/jsep.h"
#include "talk/app/webrtc/jsepicecandidate.h"
#include "talk/base/scoped_ptr.h"
#include "webrtc/base/scoped_ptr.h"
namespace cricket {
class SessionDescription;
@ -89,7 +89,7 @@ class JsepSessionDescription : public SessionDescriptionInterface {
static const int kDefaultVideoCodecPreference;
private:
talk_base::scoped_ptr<cricket::SessionDescription> description_;
rtc::scoped_ptr<cricket::SessionDescription> description_;
std::string session_id_;
std::string session_version_;
std::string type_;

View File

@ -29,11 +29,11 @@
#include "talk/app/webrtc/jsepicecandidate.h"
#include "talk/app/webrtc/jsepsessiondescription.h"
#include "talk/base/gunit.h"
#include "talk/base/helpers.h"
#include "talk/base/scoped_ptr.h"
#include "talk/base/ssladapter.h"
#include "talk/base/stringencode.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/helpers.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/ssladapter.h"
#include "webrtc/base/stringencode.h"
#include "talk/p2p/base/candidate.h"
#include "talk/p2p/base/constants.h"
#include "talk/p2p/base/sessiondescription.h"
@ -44,7 +44,7 @@ using webrtc::IceCandidateInterface;
using webrtc::JsepIceCandidate;
using webrtc::JsepSessionDescription;
using webrtc::SessionDescriptionInterface;
using talk_base::scoped_ptr;
using rtc::scoped_ptr;
static const char kCandidateUfrag[] = "ufrag";
static const char kCandidatePwd[] = "pwd";
@ -98,24 +98,24 @@ static cricket::SessionDescription* CreateCricketSessionDescription() {
class JsepSessionDescriptionTest : public testing::Test {
protected:
static void SetUpTestCase() {
talk_base::InitializeSSL();
rtc::InitializeSSL();
}
static void TearDownTestCase() {
talk_base::CleanupSSL();
rtc::CleanupSSL();
}
virtual void SetUp() {
int port = 1234;
talk_base::SocketAddress address("127.0.0.1", port++);
rtc::SocketAddress address("127.0.0.1", port++);
cricket::Candidate candidate("rtp", cricket::ICE_CANDIDATE_COMPONENT_RTP,
"udp", address, 1, "",
"", "local", "eth0", 0, "1");
candidate_ = candidate;
const std::string session_id =
talk_base::ToString(talk_base::CreateRandomId64());
rtc::ToString(rtc::CreateRandomId64());
const std::string session_version =
talk_base::ToString(talk_base::CreateRandomId());
rtc::ToString(rtc::CreateRandomId());
jsep_desc_.reset(new JsepSessionDescription("dummy"));
ASSERT_TRUE(jsep_desc_->Initialize(CreateCricketSessionDescription(),
session_id, session_version));
@ -135,7 +135,7 @@ class JsepSessionDescriptionTest : public testing::Test {
}
cricket::Candidate candidate_;
talk_base::scoped_ptr<JsepSessionDescription> jsep_desc_;
rtc::scoped_ptr<JsepSessionDescription> jsep_desc_;
};
// Test that number_of_mediasections() returns the number of media contents in

View File

@ -53,7 +53,7 @@ bool FromConstraints(const MediaConstraintsInterface::Constraints& constraints,
for (iter = constraints.begin(); iter != constraints.end(); ++iter) {
bool value = false;
if (!talk_base::FromString(iter->value, &value)) {
if (!rtc::FromString(iter->value, &value)) {
success = false;
continue;
}
@ -87,11 +87,11 @@ bool FromConstraints(const MediaConstraintsInterface::Constraints& constraints,
} // namespace
talk_base::scoped_refptr<LocalAudioSource> LocalAudioSource::Create(
rtc::scoped_refptr<LocalAudioSource> LocalAudioSource::Create(
const PeerConnectionFactoryInterface::Options& options,
const MediaConstraintsInterface* constraints) {
talk_base::scoped_refptr<LocalAudioSource> source(
new talk_base::RefCountedObject<LocalAudioSource>());
rtc::scoped_refptr<LocalAudioSource> source(
new rtc::RefCountedObject<LocalAudioSource>());
source->Initialize(options, constraints);
return source;
}

View File

@ -31,7 +31,7 @@
#include "talk/app/webrtc/mediastreaminterface.h"
#include "talk/app/webrtc/notifier.h"
#include "talk/app/webrtc/peerconnectioninterface.h"
#include "talk/base/scoped_ptr.h"
#include "webrtc/base/scoped_ptr.h"
#include "talk/media/base/mediachannel.h"
// LocalAudioSource implements AudioSourceInterface.
@ -44,7 +44,7 @@ class MediaConstraintsInterface;
class LocalAudioSource : public Notifier<AudioSourceInterface> {
public:
// Creates an instance of LocalAudioSource.
static talk_base::scoped_refptr<LocalAudioSource> Create(
static rtc::scoped_refptr<LocalAudioSource> Create(
const PeerConnectionFactoryInterface::Options& options,
const MediaConstraintsInterface* constraints);

View File

@ -31,7 +31,7 @@
#include <vector>
#include "talk/app/webrtc/test/fakeconstraints.h"
#include "talk/base/gunit.h"
#include "webrtc/base/gunit.h"
#include "talk/media/base/fakemediaengine.h"
#include "talk/media/base/fakevideorenderer.h"
#include "talk/media/devices/fakedevicemanager.h"
@ -52,7 +52,7 @@ TEST(LocalAudioSourceTest, SetValidOptions) {
constraints.AddMandatory(MediaConstraintsInterface::kNoiseSuppression, false);
constraints.AddOptional(MediaConstraintsInterface::kHighpassFilter, true);
talk_base::scoped_refptr<LocalAudioSource> source =
rtc::scoped_refptr<LocalAudioSource> source =
LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(),
&constraints);
@ -73,7 +73,7 @@ TEST(LocalAudioSourceTest, SetValidOptions) {
TEST(LocalAudioSourceTest, OptionNotSet) {
webrtc::FakeConstraints constraints;
talk_base::scoped_refptr<LocalAudioSource> source =
rtc::scoped_refptr<LocalAudioSource> source =
LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(),
&constraints);
bool value;
@ -85,7 +85,7 @@ TEST(LocalAudioSourceTest, MandatoryOverridesOptional) {
constraints.AddMandatory(MediaConstraintsInterface::kEchoCancellation, false);
constraints.AddOptional(MediaConstraintsInterface::kEchoCancellation, true);
talk_base::scoped_refptr<LocalAudioSource> source =
rtc::scoped_refptr<LocalAudioSource> source =
LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(),
&constraints);
@ -99,7 +99,7 @@ TEST(LocalAudioSourceTest, InvalidOptional) {
constraints.AddOptional(MediaConstraintsInterface::kHighpassFilter, false);
constraints.AddOptional("invalidKey", false);
talk_base::scoped_refptr<LocalAudioSource> source =
rtc::scoped_refptr<LocalAudioSource> source =
LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(),
&constraints);
@ -114,7 +114,7 @@ TEST(LocalAudioSourceTest, InvalidMandatory) {
constraints.AddMandatory(MediaConstraintsInterface::kHighpassFilter, false);
constraints.AddMandatory("invalidKey", false);
talk_base::scoped_refptr<LocalAudioSource> source =
rtc::scoped_refptr<LocalAudioSource> source =
LocalAudioSource::Create(PeerConnectionFactoryInterface::Options(),
&constraints);

View File

@ -27,7 +27,7 @@
#include "talk/app/webrtc/mediaconstraintsinterface.h"
#include "talk/base/stringencode.h"
#include "webrtc/base/stringencode.h"
namespace webrtc {
@ -153,10 +153,10 @@ bool FindConstraint(const MediaConstraintsInterface* constraints,
if (constraints->GetMandatory().FindFirst(key, &string_value)) {
if (mandatory_constraints)
++*mandatory_constraints;
return talk_base::FromString(string_value, value);
return rtc::FromString(string_value, value);
}
if (constraints->GetOptional().FindFirst(key, &string_value)) {
return talk_base::FromString(string_value, value);
return rtc::FromString(string_value, value);
}
return false;
}

View File

@ -26,7 +26,7 @@
*/
#include "talk/app/webrtc/mediastream.h"
#include "talk/base/logging.h"
#include "webrtc/base/logging.h"
namespace webrtc {
@ -42,10 +42,10 @@ static typename V::iterator FindTrack(V* vector,
return it;
};
talk_base::scoped_refptr<MediaStream> MediaStream::Create(
rtc::scoped_refptr<MediaStream> MediaStream::Create(
const std::string& label) {
talk_base::RefCountedObject<MediaStream>* stream =
new talk_base::RefCountedObject<MediaStream>(label);
rtc::RefCountedObject<MediaStream>* stream =
new rtc::RefCountedObject<MediaStream>(label);
return stream;
}
@ -69,7 +69,7 @@ bool MediaStream::RemoveTrack(VideoTrackInterface* track) {
return RemoveTrack<VideoTrackVector>(&video_tracks_, track);
}
talk_base::scoped_refptr<AudioTrackInterface>
rtc::scoped_refptr<AudioTrackInterface>
MediaStream::FindAudioTrack(const std::string& track_id) {
AudioTrackVector::iterator it = FindTrack(&audio_tracks_, track_id);
if (it == audio_tracks_.end())
@ -77,7 +77,7 @@ MediaStream::FindAudioTrack(const std::string& track_id) {
return *it;
}
talk_base::scoped_refptr<VideoTrackInterface>
rtc::scoped_refptr<VideoTrackInterface>
MediaStream::FindVideoTrack(const std::string& track_id) {
VideoTrackVector::iterator it = FindTrack(&video_tracks_, track_id);
if (it == video_tracks_.end())

View File

@ -40,7 +40,7 @@ namespace webrtc {
class MediaStream : public Notifier<MediaStreamInterface> {
public:
static talk_base::scoped_refptr<MediaStream> Create(const std::string& label);
static rtc::scoped_refptr<MediaStream> Create(const std::string& label);
virtual std::string label() const OVERRIDE { return label_; }
@ -48,9 +48,9 @@ class MediaStream : public Notifier<MediaStreamInterface> {
virtual bool AddTrack(VideoTrackInterface* track) OVERRIDE;
virtual bool RemoveTrack(AudioTrackInterface* track) OVERRIDE;
virtual bool RemoveTrack(VideoTrackInterface* track) OVERRIDE;
virtual talk_base::scoped_refptr<AudioTrackInterface>
virtual rtc::scoped_refptr<AudioTrackInterface>
FindAudioTrack(const std::string& track_id);
virtual talk_base::scoped_refptr<VideoTrackInterface>
virtual rtc::scoped_refptr<VideoTrackInterface>
FindVideoTrack(const std::string& track_id);
virtual AudioTrackVector GetAudioTracks() OVERRIDE { return audio_tracks_; }

View File

@ -30,9 +30,9 @@
#include "talk/app/webrtc/audiotrack.h"
#include "talk/app/webrtc/mediastream.h"
#include "talk/app/webrtc/videotrack.h"
#include "talk/base/refcount.h"
#include "talk/base/scoped_ptr.h"
#include "talk/base/gunit.h"
#include "webrtc/base/refcount.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/gunit.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@ -40,7 +40,7 @@ static const char kStreamLabel1[] = "local_stream_1";
static const char kVideoTrackId[] = "dummy_video_cam_1";
static const char kAudioTrackId[] = "dummy_microphone_1";
using talk_base::scoped_refptr;
using rtc::scoped_refptr;
using ::testing::Exactly;
namespace webrtc {

View File

@ -59,7 +59,7 @@ void TrackHandler::OnChanged() {
LocalAudioSinkAdapter::LocalAudioSinkAdapter() : sink_(NULL) {}
LocalAudioSinkAdapter::~LocalAudioSinkAdapter() {
talk_base::CritScope lock(&lock_);
rtc::CritScope lock(&lock_);
if (sink_)
sink_->OnClose();
}
@ -69,7 +69,7 @@ void LocalAudioSinkAdapter::OnData(const void* audio_data,
int sample_rate,
int number_of_channels,
int number_of_frames) {
talk_base::CritScope lock(&lock_);
rtc::CritScope lock(&lock_);
if (sink_) {
sink_->OnData(audio_data, bits_per_sample, sample_rate,
number_of_channels, number_of_frames);
@ -77,7 +77,7 @@ void LocalAudioSinkAdapter::OnData(const void* audio_data,
}
void LocalAudioSinkAdapter::SetSink(cricket::AudioRenderer::Sink* sink) {
talk_base::CritScope lock(&lock_);
rtc::CritScope lock(&lock_);
ASSERT(!sink || !sink_);
sink_ = sink;
}

View File

@ -39,7 +39,7 @@
#include "talk/app/webrtc/mediastreaminterface.h"
#include "talk/app/webrtc/mediastreamprovider.h"
#include "talk/app/webrtc/peerconnectioninterface.h"
#include "talk/base/thread.h"
#include "webrtc/base/thread.h"
#include "talk/media/base/audiorenderer.h"
namespace webrtc {
@ -62,7 +62,7 @@ class TrackHandler : public ObserverInterface {
virtual void OnEnabledChanged() = 0;
private:
talk_base::scoped_refptr<MediaStreamTrackInterface> track_;
rtc::scoped_refptr<MediaStreamTrackInterface> track_;
uint32 ssrc_;
MediaStreamTrackInterface::TrackState state_;
bool enabled_;
@ -87,7 +87,7 @@ class LocalAudioSinkAdapter : public AudioTrackSinkInterface,
cricket::AudioRenderer::Sink* sink_;
// Critical section protecting |sink_|.
talk_base::CriticalSection lock_;
rtc::CriticalSection lock_;
};
// LocalAudioTrackHandler listen to events on a local AudioTrack instance
@ -112,7 +112,7 @@ class LocalAudioTrackHandler : public TrackHandler {
// Used to pass the data callback from the |audio_track_| to the other
// end of cricket::AudioRenderer.
talk_base::scoped_ptr<LocalAudioSinkAdapter> sink_adapter_;
rtc::scoped_ptr<LocalAudioSinkAdapter> sink_adapter_;
};
// RemoteAudioTrackHandler listen to events on a remote AudioTrack instance
@ -196,7 +196,7 @@ class MediaStreamHandler : public ObserverInterface {
protected:
TrackHandler* FindTrackHandler(MediaStreamTrackInterface* track);
talk_base::scoped_refptr<MediaStreamInterface> stream_;
rtc::scoped_refptr<MediaStreamInterface> stream_;
AudioProviderInterface* audio_provider_;
VideoProviderInterface* video_provider_;
typedef std::vector<TrackHandler*> TrackHandlers;

View File

@ -35,7 +35,7 @@
#include "talk/app/webrtc/streamcollection.h"
#include "talk/app/webrtc/videosource.h"
#include "talk/app/webrtc/videotrack.h"
#include "talk/base/gunit.h"
#include "webrtc/base/gunit.h"
#include "talk/media/base/fakevideocapturer.h"
#include "talk/media/base/mediachannel.h"
#include "testing/gmock/include/gmock/gmock.h"
@ -79,8 +79,8 @@ class MockVideoProvider : public VideoProviderInterface {
class FakeVideoSource : public Notifier<VideoSourceInterface> {
public:
static talk_base::scoped_refptr<FakeVideoSource> Create() {
return new talk_base::RefCountedObject<FakeVideoSource>();
static rtc::scoped_refptr<FakeVideoSource> Create() {
return new rtc::RefCountedObject<FakeVideoSource>();
}
virtual cricket::VideoCapturer* GetVideoCapturer() {
return &fake_capturer_;
@ -109,7 +109,7 @@ class MediaStreamHandlerTest : public testing::Test {
virtual void SetUp() {
stream_ = MediaStream::Create(kStreamLabel1);
talk_base::scoped_refptr<VideoSourceInterface> source(
rtc::scoped_refptr<VideoSourceInterface> source(
FakeVideoSource::Create());
video_track_ = VideoTrack::Create(kVideoTrackId, source);
EXPECT_TRUE(stream_->AddTrack(video_track_));
@ -175,9 +175,9 @@ class MediaStreamHandlerTest : public testing::Test {
MockAudioProvider audio_provider_;
MockVideoProvider video_provider_;
MediaStreamHandlerContainer handlers_;
talk_base::scoped_refptr<MediaStreamInterface> stream_;
talk_base::scoped_refptr<VideoTrackInterface> video_track_;
talk_base::scoped_refptr<AudioTrackInterface> audio_track_;
rtc::scoped_refptr<MediaStreamInterface> stream_;
rtc::scoped_refptr<VideoTrackInterface> video_track_;
rtc::scoped_refptr<AudioTrackInterface> audio_track_;
};
// Test that |audio_provider_| is notified when an audio track is associated

View File

@ -37,9 +37,9 @@
#include <string>
#include <vector>
#include "talk/base/basictypes.h"
#include "talk/base/refcount.h"
#include "talk/base/scoped_ref_ptr.h"
#include "webrtc/base/basictypes.h"
#include "webrtc/base/refcount.h"
#include "webrtc/base/scoped_ref_ptr.h"
namespace cricket {
@ -73,7 +73,7 @@ class NotifierInterface {
// provide media. A source can be shared with multiple tracks.
// TODO(perkj): Implement sources for local and remote audio tracks and
// remote video tracks.
class MediaSourceInterface : public talk_base::RefCountInterface,
class MediaSourceInterface : public rtc::RefCountInterface,
public NotifierInterface {
public:
enum SourceState {
@ -90,7 +90,7 @@ class MediaSourceInterface : public talk_base::RefCountInterface,
};
// Information about a track.
class MediaStreamTrackInterface : public talk_base::RefCountInterface,
class MediaStreamTrackInterface : public rtc::RefCountInterface,
public NotifierInterface {
public:
enum TrackState {
@ -176,7 +176,7 @@ class AudioTrackSinkInterface {
// Interface of the audio processor used by the audio track to collect
// statistics.
class AudioProcessorInterface : public talk_base::RefCountInterface {
class AudioProcessorInterface : public rtc::RefCountInterface {
public:
struct AudioProcessorStats {
AudioProcessorStats() : typing_noise_detected(false),
@ -220,7 +220,7 @@ class AudioTrackInterface : public MediaStreamTrackInterface {
// Get the audio processor used by the audio track. Return NULL if the track
// does not have any processor.
// TODO(xians): Make the interface pure virtual.
virtual talk_base::scoped_refptr<AudioProcessorInterface>
virtual rtc::scoped_refptr<AudioProcessorInterface>
GetAudioProcessor() { return NULL; }
// Get a pointer to the audio renderer of this AudioTrack.
@ -233,21 +233,21 @@ class AudioTrackInterface : public MediaStreamTrackInterface {
virtual ~AudioTrackInterface() {}
};
typedef std::vector<talk_base::scoped_refptr<AudioTrackInterface> >
typedef std::vector<rtc::scoped_refptr<AudioTrackInterface> >
AudioTrackVector;
typedef std::vector<talk_base::scoped_refptr<VideoTrackInterface> >
typedef std::vector<rtc::scoped_refptr<VideoTrackInterface> >
VideoTrackVector;
class MediaStreamInterface : public talk_base::RefCountInterface,
class MediaStreamInterface : public rtc::RefCountInterface,
public NotifierInterface {
public:
virtual std::string label() const = 0;
virtual AudioTrackVector GetAudioTracks() = 0;
virtual VideoTrackVector GetVideoTracks() = 0;
virtual talk_base::scoped_refptr<AudioTrackInterface>
virtual rtc::scoped_refptr<AudioTrackInterface>
FindAudioTrack(const std::string& track_id) = 0;
virtual talk_base::scoped_refptr<VideoTrackInterface>
virtual rtc::scoped_refptr<VideoTrackInterface>
FindVideoTrack(const std::string& track_id) = 0;
virtual bool AddTrack(AudioTrackInterface* track) = 0;

View File

@ -37,9 +37,9 @@ BEGIN_PROXY_MAP(MediaStream)
PROXY_CONSTMETHOD0(std::string, label)
PROXY_METHOD0(AudioTrackVector, GetAudioTracks)
PROXY_METHOD0(VideoTrackVector, GetVideoTracks)
PROXY_METHOD1(talk_base::scoped_refptr<AudioTrackInterface>,
PROXY_METHOD1(rtc::scoped_refptr<AudioTrackInterface>,
FindAudioTrack, const std::string&)
PROXY_METHOD1(talk_base::scoped_refptr<VideoTrackInterface>,
PROXY_METHOD1(rtc::scoped_refptr<VideoTrackInterface>,
FindVideoTrack, const std::string&)
PROXY_METHOD1(bool, AddTrack, AudioTrackInterface*)
PROXY_METHOD1(bool, AddTrack, VideoTrackInterface*)

View File

@ -38,8 +38,8 @@
#include "talk/app/webrtc/sctputils.h"
#include "talk/app/webrtc/videosource.h"
#include "talk/app/webrtc/videotrack.h"
#include "talk/base/bytebuffer.h"
#include "talk/base/stringutils.h"
#include "webrtc/base/bytebuffer.h"
#include "webrtc/base/stringutils.h"
#include "talk/media/sctp/sctpdataengine.h"
static const char kDefaultStreamLabel[] = "default";
@ -48,8 +48,8 @@ static const char kDefaultVideoTrackLabel[] = "defaultv0";
namespace webrtc {
using talk_base::scoped_ptr;
using talk_base::scoped_refptr;
using rtc::scoped_ptr;
using rtc::scoped_refptr;
static bool ParseConstraints(
const MediaConstraintsInterface* constraints,
@ -130,13 +130,13 @@ static bool MediaContentDirectionHasSend(cricket::MediaContentDirection dir) {
// Factory class for creating remote MediaStreams and MediaStreamTracks.
class RemoteMediaStreamFactory {
public:
explicit RemoteMediaStreamFactory(talk_base::Thread* signaling_thread,
explicit RemoteMediaStreamFactory(rtc::Thread* signaling_thread,
cricket::ChannelManager* channel_manager)
: signaling_thread_(signaling_thread),
channel_manager_(channel_manager) {
}
talk_base::scoped_refptr<MediaStreamInterface> CreateMediaStream(
rtc::scoped_refptr<MediaStreamInterface> CreateMediaStream(
const std::string& stream_label) {
return MediaStreamProxy::Create(
signaling_thread_, MediaStream::Create(stream_label));
@ -160,7 +160,7 @@ class RemoteMediaStreamFactory {
template <typename TI, typename T, typename TP, typename S>
TI* AddTrack(MediaStreamInterface* stream, const std::string& track_id,
S* source) {
talk_base::scoped_refptr<TI> track(
rtc::scoped_refptr<TI> track(
TP::Create(signaling_thread_, T::Create(track_id, source)));
track->set_state(webrtc::MediaStreamTrackInterface::kLive);
if (stream->AddTrack(track)) {
@ -169,12 +169,12 @@ class RemoteMediaStreamFactory {
return NULL;
}
talk_base::Thread* signaling_thread_;
rtc::Thread* signaling_thread_;
cricket::ChannelManager* channel_manager_;
};
MediaStreamSignaling::MediaStreamSignaling(
talk_base::Thread* signaling_thread,
rtc::Thread* signaling_thread,
MediaStreamSignalingObserver* stream_observer,
cricket::ChannelManager* channel_manager)
: signaling_thread_(signaling_thread),
@ -210,8 +210,8 @@ bool MediaStreamSignaling::IsSctpSidAvailable(int sid) const {
// SSL_CLIENT, the allocated id starts from 0 and takes even numbers; otherwise,
// the id starts from 1 and takes odd numbers. Returns false if no id can be
// allocated.
bool MediaStreamSignaling::AllocateSctpSid(talk_base::SSLRole role, int* sid) {
int& last_id = (role == talk_base::SSL_CLIENT) ?
bool MediaStreamSignaling::AllocateSctpSid(rtc::SSLRole role, int* sid) {
int& last_id = (role == rtc::SSL_CLIENT) ?
last_allocated_sctp_even_sid_ : last_allocated_sctp_odd_sid_;
do {
@ -250,7 +250,7 @@ bool MediaStreamSignaling::AddDataChannel(DataChannel* data_channel) {
bool MediaStreamSignaling::AddDataChannelFromOpenMessage(
const cricket::ReceiveDataParams& params,
const talk_base::Buffer& payload) {
const rtc::Buffer& payload) {
if (!data_channel_factory_) {
LOG(LS_WARNING) << "Remote peer requested a DataChannel but DataChannels "
<< "are not supported.";
@ -285,9 +285,9 @@ void MediaStreamSignaling::RemoveSctpDataChannel(int sid) {
if ((*iter)->id() == sid) {
sctp_data_channels_.erase(iter);
if (talk_base::IsEven(sid) && sid <= last_allocated_sctp_even_sid_) {
if (rtc::IsEven(sid) && sid <= last_allocated_sctp_even_sid_) {
last_allocated_sctp_even_sid_ = sid - 2;
} else if (talk_base::IsOdd(sid) && sid <= last_allocated_sctp_odd_sid_) {
} else if (rtc::IsOdd(sid) && sid <= last_allocated_sctp_odd_sid_) {
last_allocated_sctp_odd_sid_ = sid - 2;
}
return;
@ -398,7 +398,7 @@ bool MediaStreamSignaling::GetOptionsForAnswer(
void MediaStreamSignaling::OnRemoteDescriptionChanged(
const SessionDescriptionInterface* desc) {
const cricket::SessionDescription* remote_desc = desc->description();
talk_base::scoped_refptr<StreamCollection> new_streams(
rtc::scoped_refptr<StreamCollection> new_streams(
StreamCollection::Create());
// Find all audio rtp streams and create corresponding remote AudioTracks
@ -433,7 +433,7 @@ void MediaStreamSignaling::OnRemoteDescriptionChanged(
const cricket::DataContentDescription* data_desc =
static_cast<const cricket::DataContentDescription*>(
data_content->description);
if (talk_base::starts_with(
if (rtc::starts_with(
data_desc->protocol().data(), cricket::kMediaProtocolRtpPrefix)) {
UpdateRemoteRtpDataChannels(data_desc->streams());
}
@ -488,7 +488,7 @@ void MediaStreamSignaling::OnLocalDescriptionChanged(
const cricket::DataContentDescription* data_desc =
static_cast<const cricket::DataContentDescription*>(
data_content->description);
if (talk_base::starts_with(
if (rtc::starts_with(
data_desc->protocol().data(), cricket::kMediaProtocolRtpPrefix)) {
UpdateLocalRtpDataChannels(data_desc->streams());
}
@ -599,7 +599,7 @@ void MediaStreamSignaling::UpdateRemoteStreamsList(
const std::string& track_id = it->id;
uint32 ssrc = it->first_ssrc();
talk_base::scoped_refptr<MediaStreamInterface> stream =
rtc::scoped_refptr<MediaStreamInterface> stream =
remote_streams_->find(stream_label);
if (!stream) {
// This is a new MediaStream. Create a new remote MediaStream.
@ -643,7 +643,7 @@ void MediaStreamSignaling::OnRemoteTrackRemoved(
MediaStreamInterface* stream = remote_streams_->find(stream_label);
if (media_type == cricket::MEDIA_TYPE_AUDIO) {
talk_base::scoped_refptr<AudioTrackInterface> audio_track =
rtc::scoped_refptr<AudioTrackInterface> audio_track =
stream->FindAudioTrack(track_id);
if (audio_track) {
audio_track->set_state(webrtc::MediaStreamTrackInterface::kEnded);
@ -651,7 +651,7 @@ void MediaStreamSignaling::OnRemoteTrackRemoved(
stream_observer_->OnRemoveRemoteAudioTrack(stream, audio_track);
}
} else if (media_type == cricket::MEDIA_TYPE_VIDEO) {
talk_base::scoped_refptr<VideoTrackInterface> video_track =
rtc::scoped_refptr<VideoTrackInterface> video_track =
stream->FindVideoTrack(track_id);
if (video_track) {
video_track->set_state(webrtc::MediaStreamTrackInterface::kEnded);
@ -898,7 +898,7 @@ void MediaStreamSignaling::UpdateRemoteRtpDataChannels(
// The data channel label is either the mslabel or the SSRC if the mslabel
// does not exist. Ex a=ssrc:444330170 mslabel:test1.
std::string label = it->sync_label.empty() ?
talk_base::ToString(it->first_ssrc()) : it->sync_label;
rtc::ToString(it->first_ssrc()) : it->sync_label;
RtpDataChannels::iterator data_channel_it =
rtp_data_channels_.find(label);
if (data_channel_it == rtp_data_channels_.end()) {
@ -963,7 +963,7 @@ void MediaStreamSignaling::OnDataTransportCreatedForSctp() {
}
}
void MediaStreamSignaling::OnDtlsRoleReadyForSctp(talk_base::SSLRole role) {
void MediaStreamSignaling::OnDtlsRoleReadyForSctp(rtc::SSLRole role) {
SctpDataChannels::iterator it = sctp_data_channels_.begin();
for (; it != sctp_data_channels_.end(); ++it) {
if ((*it)->id() < 0) {

View File

@ -36,13 +36,13 @@
#include "talk/app/webrtc/mediastream.h"
#include "talk/app/webrtc/peerconnectioninterface.h"
#include "talk/app/webrtc/streamcollection.h"
#include "talk/base/scoped_ref_ptr.h"
#include "talk/base/sigslot.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/base/sigslot.h"
#include "talk/session/media/mediasession.h"
namespace talk_base {
namespace rtc {
class Thread;
} // namespace talk_base
} // namespace rtc
namespace webrtc {
@ -160,7 +160,7 @@ class MediaStreamSignalingObserver {
class MediaStreamSignaling : public sigslot::has_slots<> {
public:
MediaStreamSignaling(talk_base::Thread* signaling_thread,
MediaStreamSignaling(rtc::Thread* signaling_thread,
MediaStreamSignalingObserver* stream_observer,
cricket::ChannelManager* channel_manager);
virtual ~MediaStreamSignaling();
@ -180,7 +180,7 @@ class MediaStreamSignaling : public sigslot::has_slots<> {
// Gets the first available SCTP id that is not assigned to any existing
// data channels.
bool AllocateSctpSid(talk_base::SSLRole role, int* sid);
bool AllocateSctpSid(rtc::SSLRole role, int* sid);
// Adds |local_stream| to the collection of known MediaStreams that will be
// offered in a SessionDescription.
@ -197,7 +197,7 @@ class MediaStreamSignaling : public sigslot::has_slots<> {
bool AddDataChannel(DataChannel* data_channel);
// After we receive an OPEN message, create a data channel and add it.
bool AddDataChannelFromOpenMessage(const cricket::ReceiveDataParams& params,
const talk_base::Buffer& payload);
const rtc::Buffer& payload);
void RemoveSctpDataChannel(int sid);
// Returns a MediaSessionOptions struct with options decided by |constraints|,
@ -249,7 +249,7 @@ class MediaStreamSignaling : public sigslot::has_slots<> {
return remote_streams_.get();
}
void OnDataTransportCreatedForSctp();
void OnDtlsRoleReadyForSctp(talk_base::SSLRole role);
void OnDtlsRoleReadyForSctp(rtc::SSLRole role);
void OnRemoteSctpDataChannelClosed(uint32 sid);
private:
@ -376,13 +376,13 @@ class MediaStreamSignaling : public sigslot::has_slots<> {
int FindDataChannelBySid(int sid) const;
RemotePeerInfo remote_info_;
talk_base::Thread* signaling_thread_;
rtc::Thread* signaling_thread_;
DataChannelFactory* data_channel_factory_;
cricket::MediaSessionOptions options_;
MediaStreamSignalingObserver* stream_observer_;
talk_base::scoped_refptr<StreamCollection> local_streams_;
talk_base::scoped_refptr<StreamCollection> remote_streams_;
talk_base::scoped_ptr<RemoteMediaStreamFactory> remote_stream_factory_;
rtc::scoped_refptr<StreamCollection> local_streams_;
rtc::scoped_refptr<StreamCollection> remote_streams_;
rtc::scoped_ptr<RemoteMediaStreamFactory> remote_stream_factory_;
TrackInfos remote_audio_tracks_;
TrackInfos remote_video_tracks_;
@ -392,9 +392,9 @@ class MediaStreamSignaling : public sigslot::has_slots<> {
int last_allocated_sctp_even_sid_;
int last_allocated_sctp_odd_sid_;
typedef std::map<std::string, talk_base::scoped_refptr<DataChannel> >
typedef std::map<std::string, rtc::scoped_refptr<DataChannel> >
RtpDataChannels;
typedef std::vector<talk_base::scoped_refptr<DataChannel> > SctpDataChannels;
typedef std::vector<rtc::scoped_refptr<DataChannel> > SctpDataChannels;
RtpDataChannels rtp_data_channels_;
SctpDataChannels sctp_data_channels_;

View File

@ -36,10 +36,10 @@
#include "talk/app/webrtc/test/fakeconstraints.h"
#include "talk/app/webrtc/test/fakedatachannelprovider.h"
#include "talk/app/webrtc/videotrack.h"
#include "talk/base/gunit.h"
#include "talk/base/scoped_ptr.h"
#include "talk/base/stringutils.h"
#include "talk/base/thread.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/stringutils.h"
#include "webrtc/base/thread.h"
#include "talk/media/base/fakemediaengine.h"
#include "talk/media/devices/fakedevicemanager.h"
#include "talk/p2p/base/constants.h"
@ -261,7 +261,7 @@ class FakeDataChannelFactory : public webrtc::DataChannelFactory {
cricket::DataChannelType dct)
: provider_(provider), type_(dct) {}
virtual talk_base::scoped_refptr<webrtc::DataChannel> CreateDataChannel(
virtual rtc::scoped_refptr<webrtc::DataChannel> CreateDataChannel(
const std::string& label,
const webrtc::InternalDataChannelInit* config) {
last_init_ = *config;
@ -449,14 +449,14 @@ class MockSignalingObserver : public webrtc::MediaStreamSignalingObserver {
TrackInfos local_audio_tracks_;
TrackInfos local_video_tracks_;
talk_base::scoped_refptr<StreamCollection> remote_media_streams_;
rtc::scoped_refptr<StreamCollection> remote_media_streams_;
};
class MediaStreamSignalingForTest : public webrtc::MediaStreamSignaling {
public:
MediaStreamSignalingForTest(MockSignalingObserver* observer,
cricket::ChannelManager* channel_manager)
: webrtc::MediaStreamSignaling(talk_base::Thread::Current(), observer,
: webrtc::MediaStreamSignaling(rtc::Thread::Current(), observer,
channel_manager) {
};
@ -473,7 +473,7 @@ class MediaStreamSignalingTest: public testing::Test {
channel_manager_.reset(
new cricket::ChannelManager(new cricket::FakeMediaEngine(),
new cricket::FakeDeviceManager(),
talk_base::Thread::Current()));
rtc::Thread::Current()));
signaling_.reset(new MediaStreamSignalingForTest(observer_.get(),
channel_manager_.get()));
data_channel_provider_.reset(new FakeDataChannelProvider());
@ -483,22 +483,22 @@ class MediaStreamSignalingTest: public testing::Test {
// CreateStreamCollection(1) creates a collection that
// correspond to kSdpString1.
// CreateStreamCollection(2) correspond to kSdpString2.
talk_base::scoped_refptr<StreamCollection>
rtc::scoped_refptr<StreamCollection>
CreateStreamCollection(int number_of_streams) {
talk_base::scoped_refptr<StreamCollection> local_collection(
rtc::scoped_refptr<StreamCollection> local_collection(
StreamCollection::Create());
for (int i = 0; i < number_of_streams; ++i) {
talk_base::scoped_refptr<webrtc::MediaStreamInterface> stream(
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream(
webrtc::MediaStream::Create(kStreams[i]));
// Add a local audio track.
talk_base::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
webrtc::AudioTrack::Create(kAudioTracks[i], NULL));
stream->AddTrack(audio_track);
// Add a local video track.
talk_base::scoped_refptr<webrtc::VideoTrackInterface> video_track(
rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track(
webrtc::VideoTrack::Create(kVideoTracks[i], NULL));
stream->AddTrack(video_track);
@ -525,7 +525,7 @@ class MediaStreamSignalingTest: public testing::Test {
std::string mediastream_label = kStreams[0];
talk_base::scoped_refptr<webrtc::MediaStreamInterface> stream(
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream(
webrtc::MediaStream::Create(mediastream_label));
reference_collection_->AddStream(stream);
@ -555,23 +555,23 @@ class MediaStreamSignalingTest: public testing::Test {
void AddAudioTrack(const std::string& track_id,
MediaStreamInterface* stream) {
talk_base::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
webrtc::AudioTrack::Create(track_id, NULL));
ASSERT_TRUE(stream->AddTrack(audio_track));
}
void AddVideoTrack(const std::string& track_id,
MediaStreamInterface* stream) {
talk_base::scoped_refptr<webrtc::VideoTrackInterface> video_track(
rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track(
webrtc::VideoTrack::Create(track_id, NULL));
ASSERT_TRUE(stream->AddTrack(video_track));
}
talk_base::scoped_refptr<webrtc::DataChannel> AddDataChannel(
rtc::scoped_refptr<webrtc::DataChannel> AddDataChannel(
cricket::DataChannelType type, const std::string& label, int id) {
webrtc::InternalDataChannelInit config;
config.id = id;
talk_base::scoped_refptr<webrtc::DataChannel> data_channel(
rtc::scoped_refptr<webrtc::DataChannel> data_channel(
webrtc::DataChannel::Create(
data_channel_provider_.get(), type, label, config));
EXPECT_TRUE(data_channel.get() != NULL);
@ -581,11 +581,11 @@ class MediaStreamSignalingTest: public testing::Test {
// ChannelManager is used by VideoSource, so it should be released after all
// the video tracks. Put it as the first private variable should ensure that.
talk_base::scoped_ptr<cricket::ChannelManager> channel_manager_;
talk_base::scoped_refptr<StreamCollection> reference_collection_;
talk_base::scoped_ptr<MockSignalingObserver> observer_;
talk_base::scoped_ptr<MediaStreamSignalingForTest> signaling_;
talk_base::scoped_ptr<FakeDataChannelProvider> data_channel_provider_;
rtc::scoped_ptr<cricket::ChannelManager> channel_manager_;
rtc::scoped_refptr<StreamCollection> reference_collection_;
rtc::scoped_ptr<MockSignalingObserver> observer_;
rtc::scoped_ptr<MediaStreamSignalingForTest> signaling_;
rtc::scoped_ptr<FakeDataChannelProvider> data_channel_provider_;
};
// Test that a MediaSessionOptions is created for an offer if
@ -686,7 +686,7 @@ TEST_F(MediaStreamSignalingTest, GetMediaSessionOptionsWithBadConstraints) {
// a MediaStream is sent and later updated with a new track.
// MediaConstraints are not used.
TEST_F(MediaStreamSignalingTest, AddTrackToLocalMediaStream) {
talk_base::scoped_refptr<StreamCollection> local_streams(
rtc::scoped_refptr<StreamCollection> local_streams(
CreateStreamCollection(1));
MediaStreamInterface* local_stream = local_streams->at(0);
EXPECT_TRUE(signaling_->AddLocalStream(local_stream));
@ -758,13 +758,13 @@ TEST_F(MediaStreamSignalingTest, MediaConstraintsInAnswer) {
// SDP string is created. In this test the two separate MediaStreams are
// signaled.
TEST_F(MediaStreamSignalingTest, UpdateRemoteStreams) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc(
rtc::scoped_ptr<SessionDescriptionInterface> desc(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringWithStream1, NULL));
EXPECT_TRUE(desc != NULL);
signaling_->OnRemoteDescriptionChanged(desc.get());
talk_base::scoped_refptr<StreamCollection> reference(
rtc::scoped_refptr<StreamCollection> reference(
CreateStreamCollection(1));
EXPECT_TRUE(CompareStreamCollections(signaling_->remote_streams(),
reference.get()));
@ -780,13 +780,13 @@ TEST_F(MediaStreamSignalingTest, UpdateRemoteStreams) {
// Create a session description based on another SDP with another
// MediaStream.
talk_base::scoped_ptr<SessionDescriptionInterface> update_desc(
rtc::scoped_ptr<SessionDescriptionInterface> update_desc(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringWith2Stream, NULL));
EXPECT_TRUE(update_desc != NULL);
signaling_->OnRemoteDescriptionChanged(update_desc.get());
talk_base::scoped_refptr<StreamCollection> reference2(
rtc::scoped_refptr<StreamCollection> reference2(
CreateStreamCollection(2));
EXPECT_TRUE(CompareStreamCollections(signaling_->remote_streams(),
reference2.get()));
@ -805,14 +805,14 @@ TEST_F(MediaStreamSignalingTest, UpdateRemoteStreams) {
// SDP string is created. In this test the same remote MediaStream is signaled
// but MediaStream tracks are added and removed.
TEST_F(MediaStreamSignalingTest, AddRemoveTrackFromExistingRemoteMediaStream) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc_ms1;
rtc::scoped_ptr<SessionDescriptionInterface> desc_ms1;
CreateSessionDescriptionAndReference(1, 1, desc_ms1.use());
signaling_->OnRemoteDescriptionChanged(desc_ms1.get());
EXPECT_TRUE(CompareStreamCollections(signaling_->remote_streams(),
reference_collection_));
// Add extra audio and video tracks to the same MediaStream.
talk_base::scoped_ptr<SessionDescriptionInterface> desc_ms1_two_tracks;
rtc::scoped_ptr<SessionDescriptionInterface> desc_ms1_two_tracks;
CreateSessionDescriptionAndReference(2, 2, desc_ms1_two_tracks.use());
signaling_->OnRemoteDescriptionChanged(desc_ms1_two_tracks.get());
EXPECT_TRUE(CompareStreamCollections(signaling_->remote_streams(),
@ -821,7 +821,7 @@ TEST_F(MediaStreamSignalingTest, AddRemoveTrackFromExistingRemoteMediaStream) {
reference_collection_));
// Remove the extra audio and video tracks again.
talk_base::scoped_ptr<SessionDescriptionInterface> desc_ms2;
rtc::scoped_ptr<SessionDescriptionInterface> desc_ms2;
CreateSessionDescriptionAndReference(1, 1, desc_ms2.use());
signaling_->OnRemoteDescriptionChanged(desc_ms2.get());
EXPECT_TRUE(CompareStreamCollections(signaling_->remote_streams(),
@ -833,7 +833,7 @@ TEST_F(MediaStreamSignalingTest, AddRemoveTrackFromExistingRemoteMediaStream) {
// This test that remote tracks are ended if a
// local session description is set that rejects the media content type.
TEST_F(MediaStreamSignalingTest, RejectMediaContent) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc(
rtc::scoped_ptr<SessionDescriptionInterface> desc(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringWithStream1, NULL));
EXPECT_TRUE(desc != NULL);
@ -844,10 +844,10 @@ TEST_F(MediaStreamSignalingTest, RejectMediaContent) {
ASSERT_EQ(1u, remote_stream->GetVideoTracks().size());
ASSERT_EQ(1u, remote_stream->GetAudioTracks().size());
talk_base::scoped_refptr<webrtc::VideoTrackInterface> remote_video =
rtc::scoped_refptr<webrtc::VideoTrackInterface> remote_video =
remote_stream->GetVideoTracks()[0];
EXPECT_EQ(webrtc::MediaStreamTrackInterface::kLive, remote_video->state());
talk_base::scoped_refptr<webrtc::AudioTrackInterface> remote_audio =
rtc::scoped_refptr<webrtc::AudioTrackInterface> remote_audio =
remote_stream->GetAudioTracks()[0];
EXPECT_EQ(webrtc::MediaStreamTrackInterface::kLive, remote_audio->state());
@ -871,7 +871,7 @@ TEST_F(MediaStreamSignalingTest, RejectMediaContent) {
// of MediaStreamSignaling and then MediaStreamSignaling tries to reject
// this track.
TEST_F(MediaStreamSignalingTest, RemoveTrackThenRejectMediaContent) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc(
rtc::scoped_ptr<SessionDescriptionInterface> desc(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringWithStream1, NULL));
EXPECT_TRUE(desc != NULL);
@ -899,7 +899,7 @@ TEST_F(MediaStreamSignalingTest, RemoveTrackThenRejectMediaContent) {
// It also tests that the default stream is updated if a video m-line is added
// in a subsequent session description.
TEST_F(MediaStreamSignalingTest, SdpWithoutMsidCreatesDefaultStream) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc_audio_only(
rtc::scoped_ptr<SessionDescriptionInterface> desc_audio_only(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringWithoutStreamsAudioOnly,
NULL));
@ -914,7 +914,7 @@ TEST_F(MediaStreamSignalingTest, SdpWithoutMsidCreatesDefaultStream) {
EXPECT_EQ(0u, remote_stream->GetVideoTracks().size());
EXPECT_EQ("default", remote_stream->label());
talk_base::scoped_ptr<SessionDescriptionInterface> desc(
rtc::scoped_ptr<SessionDescriptionInterface> desc(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringWithoutStreams, NULL));
ASSERT_TRUE(desc != NULL);
@ -931,7 +931,7 @@ TEST_F(MediaStreamSignalingTest, SdpWithoutMsidCreatesDefaultStream) {
// This tests that a default MediaStream is created if a remote session
// description doesn't contain any streams and media direction is send only.
TEST_F(MediaStreamSignalingTest, RecvOnlySdpWithoutMsidCreatesDefaultStream) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc(
rtc::scoped_ptr<SessionDescriptionInterface> desc(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringSendOnlyWithWithoutStreams,
NULL));
@ -950,7 +950,7 @@ TEST_F(MediaStreamSignalingTest, RecvOnlySdpWithoutMsidCreatesDefaultStream) {
// This tests that it won't crash when MediaStreamSignaling tries to remove
// a remote track that as already been removed from the mediastream.
TEST_F(MediaStreamSignalingTest, RemoveAlreadyGoneRemoteStream) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc_audio_only(
rtc::scoped_ptr<SessionDescriptionInterface> desc_audio_only(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringWithoutStreams,
NULL));
@ -960,7 +960,7 @@ TEST_F(MediaStreamSignalingTest, RemoveAlreadyGoneRemoteStream) {
remote_stream->RemoveTrack(remote_stream->GetAudioTracks()[0]);
remote_stream->RemoveTrack(remote_stream->GetVideoTracks()[0]);
talk_base::scoped_ptr<SessionDescriptionInterface> desc(
rtc::scoped_ptr<SessionDescriptionInterface> desc(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringWithoutStreams, NULL));
ASSERT_TRUE(desc != NULL);
@ -974,7 +974,7 @@ TEST_F(MediaStreamSignalingTest, RemoveAlreadyGoneRemoteStream) {
// MSID is supported.
TEST_F(MediaStreamSignalingTest,
SdpWithoutMsidAndStreamsCreatesDefaultStream) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc(
rtc::scoped_ptr<SessionDescriptionInterface> desc(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringWithoutStreams,
NULL));
@ -990,7 +990,7 @@ TEST_F(MediaStreamSignalingTest,
// This tests that a default MediaStream is not created if the remote session
// description doesn't contain any streams but does support MSID.
TEST_F(MediaStreamSignalingTest, SdpWitMsidDontCreatesDefaultStream) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc_msid_without_streams(
rtc::scoped_ptr<SessionDescriptionInterface> desc_msid_without_streams(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringWithMsidWithoutStreams,
NULL));
@ -1001,18 +1001,18 @@ TEST_F(MediaStreamSignalingTest, SdpWitMsidDontCreatesDefaultStream) {
// This test that a default MediaStream is not created if a remote session
// description is updated to not have any MediaStreams.
TEST_F(MediaStreamSignalingTest, VerifyDefaultStreamIsNotCreated) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc(
rtc::scoped_ptr<SessionDescriptionInterface> desc(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringWithStream1,
NULL));
ASSERT_TRUE(desc != NULL);
signaling_->OnRemoteDescriptionChanged(desc.get());
talk_base::scoped_refptr<StreamCollection> reference(
rtc::scoped_refptr<StreamCollection> reference(
CreateStreamCollection(1));
EXPECT_TRUE(CompareStreamCollections(observer_->remote_streams(),
reference.get()));
talk_base::scoped_ptr<SessionDescriptionInterface> desc_without_streams(
rtc::scoped_ptr<SessionDescriptionInterface> desc_without_streams(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
kSdpStringWithoutStreams,
NULL));
@ -1024,7 +1024,7 @@ TEST_F(MediaStreamSignalingTest, VerifyDefaultStreamIsNotCreated) {
// when MediaStreamSignaling::OnLocalDescriptionChanged is called with an
// updated local session description.
TEST_F(MediaStreamSignalingTest, LocalDescriptionChanged) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc_1;
rtc::scoped_ptr<SessionDescriptionInterface> desc_1;
CreateSessionDescriptionAndReference(2, 2, desc_1.use());
signaling_->AddLocalStream(reference_collection_->at(0));
@ -1037,7 +1037,7 @@ TEST_F(MediaStreamSignalingTest, LocalDescriptionChanged) {
observer_->VerifyLocalVideoTrack(kStreams[0], kVideoTracks[1], 4);
// Remove an audio and video track.
talk_base::scoped_ptr<SessionDescriptionInterface> desc_2;
rtc::scoped_ptr<SessionDescriptionInterface> desc_2;
CreateSessionDescriptionAndReference(1, 1, desc_2.use());
signaling_->OnLocalDescriptionChanged(desc_2.get());
EXPECT_EQ(1u, observer_->NumberOfLocalAudioTracks());
@ -1050,7 +1050,7 @@ TEST_F(MediaStreamSignalingTest, LocalDescriptionChanged) {
// when MediaStreamSignaling::AddLocalStream is called after
// MediaStreamSignaling::OnLocalDescriptionChanged is called.
TEST_F(MediaStreamSignalingTest, AddLocalStreamAfterLocalDescriptionChanged) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc_1;
rtc::scoped_ptr<SessionDescriptionInterface> desc_1;
CreateSessionDescriptionAndReference(2, 2, desc_1.use());
signaling_->OnLocalDescriptionChanged(desc_1.get());
@ -1070,7 +1070,7 @@ TEST_F(MediaStreamSignalingTest, AddLocalStreamAfterLocalDescriptionChanged) {
// if the ssrc on a local track is changed when
// MediaStreamSignaling::OnLocalDescriptionChanged is called.
TEST_F(MediaStreamSignalingTest, ChangeSsrcOnTrackInLocalSessionDescription) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc;
rtc::scoped_ptr<SessionDescriptionInterface> desc;
CreateSessionDescriptionAndReference(1, 1, desc.use());
signaling_->AddLocalStream(reference_collection_->at(0));
@ -1085,15 +1085,15 @@ TEST_F(MediaStreamSignalingTest, ChangeSsrcOnTrackInLocalSessionDescription) {
desc->ToString(&sdp);
std::string ssrc_org = "a=ssrc:1";
std::string ssrc_to = "a=ssrc:97";
talk_base::replace_substrs(ssrc_org.c_str(), ssrc_org.length(),
rtc::replace_substrs(ssrc_org.c_str(), ssrc_org.length(),
ssrc_to.c_str(), ssrc_to.length(),
&sdp);
ssrc_org = "a=ssrc:2";
ssrc_to = "a=ssrc:98";
talk_base::replace_substrs(ssrc_org.c_str(), ssrc_org.length(),
rtc::replace_substrs(ssrc_org.c_str(), ssrc_org.length(),
ssrc_to.c_str(), ssrc_to.length(),
&sdp);
talk_base::scoped_ptr<SessionDescriptionInterface> updated_desc(
rtc::scoped_ptr<SessionDescriptionInterface> updated_desc(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
sdp, NULL));
@ -1108,7 +1108,7 @@ TEST_F(MediaStreamSignalingTest, ChangeSsrcOnTrackInLocalSessionDescription) {
// if a new session description is set with the same tracks but they are now
// sent on a another MediaStream.
TEST_F(MediaStreamSignalingTest, SignalSameTracksInSeparateMediaStream) {
talk_base::scoped_ptr<SessionDescriptionInterface> desc;
rtc::scoped_ptr<SessionDescriptionInterface> desc;
CreateSessionDescriptionAndReference(1, 1, desc.use());
signaling_->AddLocalStream(reference_collection_->at(0));
@ -1122,7 +1122,7 @@ TEST_F(MediaStreamSignalingTest, SignalSameTracksInSeparateMediaStream) {
// Add a new MediaStream but with the same tracks as in the first stream.
std::string stream_label_1 = kStreams[1];
talk_base::scoped_refptr<webrtc::MediaStreamInterface> stream_1(
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream_1(
webrtc::MediaStream::Create(kStreams[1]));
stream_1->AddTrack(reference_collection_->at(0)->GetVideoTracks()[0]);
stream_1->AddTrack(reference_collection_->at(0)->GetAudioTracks()[0]);
@ -1131,10 +1131,10 @@ TEST_F(MediaStreamSignalingTest, SignalSameTracksInSeparateMediaStream) {
// Replace msid in the original SDP.
std::string sdp;
desc->ToString(&sdp);
talk_base::replace_substrs(
rtc::replace_substrs(
kStreams[0], strlen(kStreams[0]), kStreams[1], strlen(kStreams[1]), &sdp);
talk_base::scoped_ptr<SessionDescriptionInterface> updated_desc(
rtc::scoped_ptr<SessionDescriptionInterface> updated_desc(
webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer,
sdp, NULL));
@ -1149,13 +1149,13 @@ TEST_F(MediaStreamSignalingTest, SignalSameTracksInSeparateMediaStream) {
// SSL_SERVER.
TEST_F(MediaStreamSignalingTest, SctpIdAllocationBasedOnRole) {
int id;
ASSERT_TRUE(signaling_->AllocateSctpSid(talk_base::SSL_SERVER, &id));
ASSERT_TRUE(signaling_->AllocateSctpSid(rtc::SSL_SERVER, &id));
EXPECT_EQ(1, id);
ASSERT_TRUE(signaling_->AllocateSctpSid(talk_base::SSL_CLIENT, &id));
ASSERT_TRUE(signaling_->AllocateSctpSid(rtc::SSL_CLIENT, &id));
EXPECT_EQ(0, id);
ASSERT_TRUE(signaling_->AllocateSctpSid(talk_base::SSL_SERVER, &id));
ASSERT_TRUE(signaling_->AllocateSctpSid(rtc::SSL_SERVER, &id));
EXPECT_EQ(3, id);
ASSERT_TRUE(signaling_->AllocateSctpSid(talk_base::SSL_CLIENT, &id));
ASSERT_TRUE(signaling_->AllocateSctpSid(rtc::SSL_CLIENT, &id));
EXPECT_EQ(2, id);
}
@ -1165,13 +1165,13 @@ TEST_F(MediaStreamSignalingTest, SctpIdAllocationNoReuse) {
AddDataChannel(cricket::DCT_SCTP, "a", old_id);
int new_id;
ASSERT_TRUE(signaling_->AllocateSctpSid(talk_base::SSL_SERVER, &new_id));
ASSERT_TRUE(signaling_->AllocateSctpSid(rtc::SSL_SERVER, &new_id));
EXPECT_NE(old_id, new_id);
// Creates a DataChannel with id 0.
old_id = 0;
AddDataChannel(cricket::DCT_SCTP, "a", old_id);
ASSERT_TRUE(signaling_->AllocateSctpSid(talk_base::SSL_CLIENT, &new_id));
ASSERT_TRUE(signaling_->AllocateSctpSid(rtc::SSL_CLIENT, &new_id));
EXPECT_NE(old_id, new_id);
}
@ -1183,12 +1183,12 @@ TEST_F(MediaStreamSignalingTest, SctpIdReusedForRemovedDataChannel) {
AddDataChannel(cricket::DCT_SCTP, "a", even_id);
int allocated_id = -1;
ASSERT_TRUE(signaling_->AllocateSctpSid(talk_base::SSL_SERVER,
ASSERT_TRUE(signaling_->AllocateSctpSid(rtc::SSL_SERVER,
&allocated_id));
EXPECT_EQ(odd_id + 2, allocated_id);
AddDataChannel(cricket::DCT_SCTP, "a", allocated_id);
ASSERT_TRUE(signaling_->AllocateSctpSid(talk_base::SSL_CLIENT,
ASSERT_TRUE(signaling_->AllocateSctpSid(rtc::SSL_CLIENT,
&allocated_id));
EXPECT_EQ(even_id + 2, allocated_id);
AddDataChannel(cricket::DCT_SCTP, "a", allocated_id);
@ -1197,20 +1197,20 @@ TEST_F(MediaStreamSignalingTest, SctpIdReusedForRemovedDataChannel) {
signaling_->RemoveSctpDataChannel(even_id);
// Verifies that removed DataChannel ids are reused.
ASSERT_TRUE(signaling_->AllocateSctpSid(talk_base::SSL_SERVER,
ASSERT_TRUE(signaling_->AllocateSctpSid(rtc::SSL_SERVER,
&allocated_id));
EXPECT_EQ(odd_id, allocated_id);
ASSERT_TRUE(signaling_->AllocateSctpSid(talk_base::SSL_CLIENT,
ASSERT_TRUE(signaling_->AllocateSctpSid(rtc::SSL_CLIENT,
&allocated_id));
EXPECT_EQ(even_id, allocated_id);
// Verifies that used higher DataChannel ids are not reused.
ASSERT_TRUE(signaling_->AllocateSctpSid(talk_base::SSL_SERVER,
ASSERT_TRUE(signaling_->AllocateSctpSid(rtc::SSL_SERVER,
&allocated_id));
EXPECT_NE(odd_id + 2, allocated_id);
ASSERT_TRUE(signaling_->AllocateSctpSid(talk_base::SSL_CLIENT,
ASSERT_TRUE(signaling_->AllocateSctpSid(rtc::SSL_CLIENT,
&allocated_id));
EXPECT_NE(even_id + 2, allocated_id);
@ -1221,7 +1221,7 @@ TEST_F(MediaStreamSignalingTest, RtpDuplicatedLabelNotAllowed) {
AddDataChannel(cricket::DCT_RTP, "a", -1);
webrtc::InternalDataChannelInit config;
talk_base::scoped_refptr<webrtc::DataChannel> data_channel =
rtc::scoped_refptr<webrtc::DataChannel> data_channel =
webrtc::DataChannel::Create(
data_channel_provider_.get(), cricket::DCT_RTP, "a", config);
ASSERT_TRUE(data_channel.get() != NULL);
@ -1242,7 +1242,7 @@ TEST_F(MediaStreamSignalingTest, CreateDataChannelFromOpenMessage) {
signaling_->SetDataChannelFactory(&fake_factory);
webrtc::DataChannelInit config;
config.id = 1;
talk_base::Buffer payload;
rtc::Buffer payload;
webrtc::WriteDataChannelOpenMessage("a", config, &payload);
cricket::ReceiveDataParams params;
params.ssrc = config.id;
@ -1262,7 +1262,7 @@ TEST_F(MediaStreamSignalingTest, DuplicatedLabelFromOpenMessageAllowed) {
signaling_->SetDataChannelFactory(&fake_factory);
webrtc::DataChannelInit config;
config.id = 0;
talk_base::Buffer payload;
rtc::Buffer payload;
webrtc::WriteDataChannelOpenMessage("a", config, &payload);
cricket::ReceiveDataParams params;
params.ssrc = config.id;
@ -1275,7 +1275,7 @@ TEST_F(MediaStreamSignalingTest,
webrtc::InternalDataChannelInit config;
config.id = 0;
talk_base::scoped_refptr<webrtc::DataChannel> data_channel =
rtc::scoped_refptr<webrtc::DataChannel> data_channel =
webrtc::DataChannel::Create(
data_channel_provider_.get(), cricket::DCT_SCTP, "a", config);
ASSERT_TRUE(data_channel.get() != NULL);

View File

@ -45,7 +45,7 @@ BEGIN_PROXY_MAP(AudioTrack)
PROXY_METHOD1(void, AddSink, AudioTrackSinkInterface*)
PROXY_METHOD1(void, RemoveSink, AudioTrackSinkInterface*)
PROXY_METHOD1(bool, GetSignalLevel, int*)
PROXY_METHOD0(talk_base::scoped_refptr<AudioProcessorInterface>,
PROXY_METHOD0(rtc::scoped_refptr<AudioProcessorInterface>,
GetAudioProcessor)
PROXY_METHOD0(cricket::AudioRenderer*, GetRenderer)

View File

@ -30,7 +30,7 @@
#include <list>
#include "talk/base/common.h"
#include "webrtc/base/common.h"
#include "talk/app/webrtc/mediastreaminterface.h"
namespace webrtc {

View File

@ -32,6 +32,6 @@
@interface RTCAudioTrack (Internal)
@property(nonatomic, assign, readonly)
talk_base::scoped_refptr<webrtc::AudioTrackInterface> audioTrack;
rtc::scoped_refptr<webrtc::AudioTrackInterface> audioTrack;
@end

View File

@ -38,7 +38,7 @@
@implementation RTCAudioTrack (Internal)
- (talk_base::scoped_refptr<webrtc::AudioTrackInterface>)audioTrack {
- (rtc::scoped_refptr<webrtc::AudioTrackInterface>)audioTrack {
return static_cast<webrtc::AudioTrackInterface*>(self.mediaTrack.get());
}

View File

@ -28,7 +28,7 @@
#import "RTCDataChannel.h"
#include "talk/app/webrtc/datachannelinterface.h"
#include "talk/base/scoped_ref_ptr.h"
#include "webrtc/base/scoped_ref_ptr.h"
@interface RTCDataBuffer (Internal)
@ -47,9 +47,9 @@
@interface RTCDataChannel (Internal)
@property(nonatomic, readonly)
talk_base::scoped_refptr<webrtc::DataChannelInterface> dataChannel;
rtc::scoped_refptr<webrtc::DataChannelInterface> dataChannel;
- (instancetype)initWithDataChannel:
(talk_base::scoped_refptr<webrtc::DataChannelInterface>)dataChannel;
(rtc::scoped_refptr<webrtc::DataChannelInterface>)dataChannel;
@end

View File

@ -135,13 +135,13 @@ std::string StdStringFromNSString(NSString* nsString) {
@end
@implementation RTCDataBuffer {
talk_base::scoped_ptr<webrtc::DataBuffer> _dataBuffer;
rtc::scoped_ptr<webrtc::DataBuffer> _dataBuffer;
}
- (instancetype)initWithData:(NSData*)data isBinary:(BOOL)isBinary {
NSAssert(data, @"data cannot be nil");
if (self = [super init]) {
talk_base::Buffer buffer([data bytes], [data length]);
rtc::Buffer buffer([data bytes], [data length]);
_dataBuffer.reset(new webrtc::DataBuffer(buffer, isBinary));
}
return self;
@ -174,8 +174,8 @@ std::string StdStringFromNSString(NSString* nsString) {
@end
@implementation RTCDataChannel {
talk_base::scoped_refptr<webrtc::DataChannelInterface> _dataChannel;
talk_base::scoped_ptr<webrtc::RTCDataChannelObserver> _observer;
rtc::scoped_refptr<webrtc::DataChannelInterface> _dataChannel;
rtc::scoped_ptr<webrtc::RTCDataChannelObserver> _observer;
BOOL _isObserverRegistered;
}
@ -256,7 +256,7 @@ std::string StdStringFromNSString(NSString* nsString) {
@implementation RTCDataChannel (Internal)
- (instancetype)initWithDataChannel:
(talk_base::scoped_refptr<webrtc::DataChannelInterface>)
(rtc::scoped_refptr<webrtc::DataChannelInterface>)
dataChannel {
NSAssert(dataChannel != NULL, @"dataChannel cannot be NULL");
if (self = [super init]) {
@ -266,7 +266,7 @@ std::string StdStringFromNSString(NSString* nsString) {
return self;
}
- (talk_base::scoped_refptr<webrtc::DataChannelInterface>)dataChannel {
- (rtc::scoped_refptr<webrtc::DataChannelInterface>)dataChannel {
return _dataChannel;
}

View File

@ -27,11 +27,11 @@
#import "RTCI420Frame.h"
#include "talk/base/scoped_ptr.h"
#include "webrtc/base/scoped_ptr.h"
#include "talk/media/base/videoframe.h"
@implementation RTCI420Frame {
talk_base::scoped_ptr<cricket::VideoFrame> _videoFrame;
rtc::scoped_ptr<cricket::VideoFrame> _videoFrame;
}
- (NSUInteger)width {

View File

@ -33,13 +33,13 @@
#import "RTCPair.h"
#include "talk/base/scoped_ptr.h"
#include "webrtc/base/scoped_ptr.h"
// TODO(hughv): Add accessors for mandatory and optional constraints.
// TODO(hughv): Add description.
@implementation RTCMediaConstraints {
talk_base::scoped_ptr<webrtc::RTCMediaConstraintsNative> _constraints;
rtc::scoped_ptr<webrtc::RTCMediaConstraintsNative> _constraints;
webrtc::MediaConstraintsInterface::Constraints _mandatory;
webrtc::MediaConstraintsInterface::Constraints _optional;
}

View File

@ -32,9 +32,9 @@
@interface RTCMediaSource (Internal)
@property(nonatomic, assign, readonly)
talk_base::scoped_refptr<webrtc::MediaSourceInterface> mediaSource;
rtc::scoped_refptr<webrtc::MediaSourceInterface> mediaSource;
- (id)initWithMediaSource:
(talk_base::scoped_refptr<webrtc::MediaSourceInterface>)mediaSource;
(rtc::scoped_refptr<webrtc::MediaSourceInterface>)mediaSource;
@end

View File

@ -34,7 +34,7 @@
#import "RTCEnumConverter.h"
@implementation RTCMediaSource {
talk_base::scoped_refptr<webrtc::MediaSourceInterface> _mediaSource;
rtc::scoped_refptr<webrtc::MediaSourceInterface> _mediaSource;
}
- (RTCSourceState)state {
@ -46,7 +46,7 @@
@implementation RTCMediaSource (Internal)
- (id)initWithMediaSource:
(talk_base::scoped_refptr<webrtc::MediaSourceInterface>)mediaSource {
(rtc::scoped_refptr<webrtc::MediaSourceInterface>)mediaSource {
if (!mediaSource) {
NSAssert(NO, @"nil arguments not allowed");
self = nil;
@ -58,7 +58,7 @@
return self;
}
- (talk_base::scoped_refptr<webrtc::MediaSourceInterface>)mediaSource {
- (rtc::scoped_refptr<webrtc::MediaSourceInterface>)mediaSource {
return _mediaSource;
}

View File

@ -32,9 +32,9 @@
@interface RTCMediaStream (Internal)
@property(nonatomic, assign, readonly)
talk_base::scoped_refptr<webrtc::MediaStreamInterface> mediaStream;
rtc::scoped_refptr<webrtc::MediaStreamInterface> mediaStream;
- (id)initWithMediaStream:
(talk_base::scoped_refptr<webrtc::MediaStreamInterface>)mediaStream;
(rtc::scoped_refptr<webrtc::MediaStreamInterface>)mediaStream;
@end

View File

@ -40,7 +40,7 @@
@implementation RTCMediaStream {
NSMutableArray* _audioTracks;
NSMutableArray* _videoTracks;
talk_base::scoped_refptr<webrtc::MediaStreamInterface> _mediaStream;
rtc::scoped_refptr<webrtc::MediaStreamInterface> _mediaStream;
}
- (NSString*)description {
@ -105,7 +105,7 @@
@implementation RTCMediaStream (Internal)
- (id)initWithMediaStream:
(talk_base::scoped_refptr<webrtc::MediaStreamInterface>)mediaStream {
(rtc::scoped_refptr<webrtc::MediaStreamInterface>)mediaStream {
if (!mediaStream) {
NSAssert(NO, @"nil arguments not allowed");
self = nil;
@ -120,7 +120,7 @@
_mediaStream = mediaStream;
for (size_t i = 0; i < audio_tracks.size(); ++i) {
talk_base::scoped_refptr<webrtc::AudioTrackInterface> track =
rtc::scoped_refptr<webrtc::AudioTrackInterface> track =
audio_tracks[i];
RTCAudioTrack* audioTrack =
[[RTCAudioTrack alloc] initWithMediaTrack:track];
@ -128,7 +128,7 @@
}
for (size_t i = 0; i < video_tracks.size(); ++i) {
talk_base::scoped_refptr<webrtc::VideoTrackInterface> track =
rtc::scoped_refptr<webrtc::VideoTrackInterface> track =
video_tracks[i];
RTCVideoTrack* videoTrack =
[[RTCVideoTrack alloc] initWithMediaTrack:track];
@ -138,7 +138,7 @@
return self;
}
- (talk_base::scoped_refptr<webrtc::MediaStreamInterface>)mediaStream {
- (rtc::scoped_refptr<webrtc::MediaStreamInterface>)mediaStream {
return _mediaStream;
}

View File

@ -32,9 +32,9 @@
@interface RTCMediaStreamTrack (Internal)
@property(nonatomic, assign, readonly)
talk_base::scoped_refptr<webrtc::MediaStreamTrackInterface> mediaTrack;
rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> mediaTrack;
- (id)initWithMediaTrack:
(talk_base::scoped_refptr<webrtc::MediaStreamTrackInterface>)mediaTrack;
(rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)mediaTrack;
@end

View File

@ -48,8 +48,8 @@ class RTCMediaStreamTrackObserver : public ObserverInterface {
}
@implementation RTCMediaStreamTrack {
talk_base::scoped_refptr<webrtc::MediaStreamTrackInterface> _mediaTrack;
talk_base::scoped_ptr<webrtc::RTCMediaStreamTrackObserver> _observer;
rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> _mediaTrack;
rtc::scoped_ptr<webrtc::RTCMediaStreamTrackObserver> _observer;
}
@synthesize label;
@ -100,7 +100,7 @@ class RTCMediaStreamTrackObserver : public ObserverInterface {
@implementation RTCMediaStreamTrack (Internal)
- (id)initWithMediaTrack:
(talk_base::scoped_refptr<webrtc::MediaStreamTrackInterface>)
(rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)
mediaTrack {
if (!mediaTrack) {
NSAssert(NO, @"nil arguments not allowed");
@ -120,7 +120,7 @@ class RTCMediaStreamTrackObserver : public ObserverInterface {
_mediaTrack->UnregisterObserver(_observer.get());
}
- (talk_base::scoped_refptr<webrtc::MediaStreamTrackInterface>)mediaTrack {
- (rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)mediaTrack {
return _mediaTrack;
}

View File

@ -34,7 +34,7 @@
@interface RTCPeerConnection (Internal)
@property(nonatomic, assign, readonly)
talk_base::scoped_refptr<webrtc::PeerConnectionInterface> peerConnection;
rtc::scoped_refptr<webrtc::PeerConnectionInterface> peerConnection;
- (instancetype)initWithFactory:(webrtc::PeerConnectionFactoryInterface*)factory
iceServers:(const webrtc::PeerConnectionInterface::IceServers&)iceServers

View File

@ -141,12 +141,12 @@ class RTCStatsObserver : public StatsObserver {
@implementation RTCPeerConnection {
NSMutableArray* _localStreams;
talk_base::scoped_ptr<webrtc::RTCPeerConnectionObserver> _observer;
talk_base::scoped_refptr<webrtc::PeerConnectionInterface> _peerConnection;
rtc::scoped_ptr<webrtc::RTCPeerConnectionObserver> _observer;
rtc::scoped_refptr<webrtc::PeerConnectionInterface> _peerConnection;
}
- (BOOL)addICECandidate:(RTCICECandidate*)candidate {
talk_base::scoped_ptr<const webrtc::IceCandidateInterface> iceCandidate(
rtc::scoped_ptr<const webrtc::IceCandidateInterface> iceCandidate(
candidate.candidate);
return self.peerConnection->AddIceCandidate(iceCandidate.get());
}
@ -165,7 +165,7 @@ class RTCStatsObserver : public StatsObserver {
- (RTCDataChannel*)createDataChannelWithLabel:(NSString*)label
config:(RTCDataChannelInit*)config {
std::string labelString([label UTF8String]);
talk_base::scoped_refptr<webrtc::DataChannelInterface> dataChannel =
rtc::scoped_refptr<webrtc::DataChannelInterface> dataChannel =
self.peerConnection->CreateDataChannel(labelString,
config.dataChannelInit);
return [[RTCDataChannel alloc] initWithDataChannel:dataChannel];
@ -173,16 +173,16 @@ class RTCStatsObserver : public StatsObserver {
- (void)createAnswerWithDelegate:(id<RTCSessionDescriptionDelegate>)delegate
constraints:(RTCMediaConstraints*)constraints {
talk_base::scoped_refptr<webrtc::RTCCreateSessionDescriptionObserver>
observer(new talk_base::RefCountedObject<
rtc::scoped_refptr<webrtc::RTCCreateSessionDescriptionObserver>
observer(new rtc::RefCountedObject<
webrtc::RTCCreateSessionDescriptionObserver>(delegate, self));
self.peerConnection->CreateAnswer(observer, constraints.constraints);
}
- (void)createOfferWithDelegate:(id<RTCSessionDescriptionDelegate>)delegate
constraints:(RTCMediaConstraints*)constraints {
talk_base::scoped_refptr<webrtc::RTCCreateSessionDescriptionObserver>
observer(new talk_base::RefCountedObject<
rtc::scoped_refptr<webrtc::RTCCreateSessionDescriptionObserver>
observer(new rtc::RefCountedObject<
webrtc::RTCCreateSessionDescriptionObserver>(delegate, self));
self.peerConnection->CreateOffer(observer, constraints.constraints);
}
@ -195,8 +195,8 @@ class RTCStatsObserver : public StatsObserver {
- (void)setLocalDescriptionWithDelegate:
(id<RTCSessionDescriptionDelegate>)delegate
sessionDescription:(RTCSessionDescription*)sdp {
talk_base::scoped_refptr<webrtc::RTCSetSessionDescriptionObserver> observer(
new talk_base::RefCountedObject<webrtc::RTCSetSessionDescriptionObserver>(
rtc::scoped_refptr<webrtc::RTCSetSessionDescriptionObserver> observer(
new rtc::RefCountedObject<webrtc::RTCSetSessionDescriptionObserver>(
delegate, self));
self.peerConnection->SetLocalDescription(observer, sdp.sessionDescription);
}
@ -204,8 +204,8 @@ class RTCStatsObserver : public StatsObserver {
- (void)setRemoteDescriptionWithDelegate:
(id<RTCSessionDescriptionDelegate>)delegate
sessionDescription:(RTCSessionDescription*)sdp {
talk_base::scoped_refptr<webrtc::RTCSetSessionDescriptionObserver> observer(
new talk_base::RefCountedObject<webrtc::RTCSetSessionDescriptionObserver>(
rtc::scoped_refptr<webrtc::RTCSetSessionDescriptionObserver> observer(
new rtc::RefCountedObject<webrtc::RTCSetSessionDescriptionObserver>(
delegate, self));
self.peerConnection->SetRemoteDescription(observer, sdp.sessionDescription);
}
@ -261,8 +261,8 @@ class RTCStatsObserver : public StatsObserver {
- (BOOL)getStatsWithDelegate:(id<RTCStatsDelegate>)delegate
mediaStreamTrack:(RTCMediaStreamTrack*)mediaStreamTrack
statsOutputLevel:(RTCStatsOutputLevel)statsOutputLevel {
talk_base::scoped_refptr<webrtc::RTCStatsObserver> observer(
new talk_base::RefCountedObject<webrtc::RTCStatsObserver>(delegate,
rtc::scoped_refptr<webrtc::RTCStatsObserver> observer(
new rtc::RefCountedObject<webrtc::RTCStatsObserver>(delegate,
self));
webrtc::PeerConnectionInterface::StatsOutputLevel nativeOutputLevel =
[RTCEnumConverter convertStatsOutputLevelToNative:statsOutputLevel];
@ -287,7 +287,7 @@ class RTCStatsObserver : public StatsObserver {
return self;
}
- (talk_base::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection {
- (rtc::scoped_refptr<webrtc::PeerConnectionInterface>)peerConnection {
return _peerConnection;
}

View File

@ -51,12 +51,12 @@
#include "talk/app/webrtc/peerconnectioninterface.h"
#include "talk/app/webrtc/videosourceinterface.h"
#include "talk/app/webrtc/videotrack.h"
#include "talk/base/logging.h"
#include "talk/base/ssladapter.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/ssladapter.h"
@interface RTCPeerConnectionFactory ()
@property(nonatomic, assign) talk_base::scoped_refptr<
@property(nonatomic, assign) rtc::scoped_refptr<
webrtc::PeerConnectionFactoryInterface> nativeFactory;
@end
@ -66,12 +66,12 @@
@synthesize nativeFactory = _nativeFactory;
+ (void)initializeSSL {
BOOL initialized = talk_base::InitializeSSL();
BOOL initialized = rtc::InitializeSSL();
NSAssert(initialized, @"Failed to initialize SSL library");
}
+ (void)deinitializeSSL {
BOOL deinitialized = talk_base::CleanupSSL();
BOOL deinitialized = rtc::CleanupSSL();
NSAssert(deinitialized, @"Failed to deinitialize SSL library");
}
@ -80,7 +80,7 @@
_nativeFactory = webrtc::CreatePeerConnectionFactory();
NSAssert(_nativeFactory, @"Failed to initialize PeerConnectionFactory!");
// Uncomment to get sensitive logs emitted (to stderr or logcat).
// talk_base::LogMessage::LogToDebug(talk_base::LS_SENSITIVE);
// rtc::LogMessage::LogToDebug(rtc::LS_SENSITIVE);
}
return self;
}
@ -102,7 +102,7 @@
}
- (RTCMediaStream*)mediaStreamWithLabel:(NSString*)label {
talk_base::scoped_refptr<webrtc::MediaStreamInterface> nativeMediaStream =
rtc::scoped_refptr<webrtc::MediaStreamInterface> nativeMediaStream =
self.nativeFactory->CreateLocalMediaStream([label UTF8String]);
return [[RTCMediaStream alloc] initWithMediaStream:nativeMediaStream];
}
@ -112,7 +112,7 @@
if (!capturer) {
return nil;
}
talk_base::scoped_refptr<webrtc::VideoSourceInterface> source =
rtc::scoped_refptr<webrtc::VideoSourceInterface> source =
self.nativeFactory->CreateVideoSource([capturer takeNativeCapturer],
constraints.constraints);
return [[RTCVideoSource alloc] initWithMediaSource:source];
@ -120,14 +120,14 @@
- (RTCVideoTrack*)videoTrackWithID:(NSString*)videoId
source:(RTCVideoSource*)source {
talk_base::scoped_refptr<webrtc::VideoTrackInterface> track =
rtc::scoped_refptr<webrtc::VideoTrackInterface> track =
self.nativeFactory->CreateVideoTrack([videoId UTF8String],
source.videoSource);
return [[RTCVideoTrack alloc] initWithMediaTrack:track];
}
- (RTCAudioTrack*)audioTrackWithID:(NSString*)audioId {
talk_base::scoped_refptr<webrtc::AudioTrackInterface> track =
rtc::scoped_refptr<webrtc::AudioTrackInterface> track =
self.nativeFactory->CreateAudioTrack([audioId UTF8String], NULL);
return [[RTCAudioTrack alloc] initWithMediaTrack:track];
}

View File

@ -35,12 +35,12 @@
#include "talk/media/devices/devicemanager.h"
@implementation RTCVideoCapturer {
talk_base::scoped_ptr<cricket::VideoCapturer> _capturer;
rtc::scoped_ptr<cricket::VideoCapturer> _capturer;
}
+ (RTCVideoCapturer*)capturerWithDeviceName:(NSString*)deviceName {
const std::string& device_name = std::string([deviceName UTF8String]);
talk_base::scoped_ptr<cricket::DeviceManagerInterface> device_manager(
rtc::scoped_ptr<cricket::DeviceManagerInterface> device_manager(
cricket::DeviceManagerFactory::Create());
bool initialized = device_manager->Init();
NSAssert(initialized, @"DeviceManager::Init() failed");
@ -49,7 +49,7 @@
LOG(LS_ERROR) << "GetVideoCaptureDevice failed";
return 0;
}
talk_base::scoped_ptr<cricket::VideoCapturer> capturer(
rtc::scoped_ptr<cricket::VideoCapturer> capturer(
device_manager->CreateVideoCapturer(device));
RTCVideoCapturer* rtcCapturer =
[[RTCVideoCapturer alloc] initWithCapturer:capturer.release()];

View File

@ -61,7 +61,7 @@ class RTCVideoRendererAdapter : public VideoRendererInterface {
}
@implementation RTCVideoRenderer {
talk_base::scoped_ptr<webrtc::RTCVideoRendererAdapter> _adapter;
rtc::scoped_ptr<webrtc::RTCVideoRendererAdapter> _adapter;
#if TARGET_OS_IPHONE
RTCEAGLVideoView* _videoView;
#endif

View File

@ -32,6 +32,6 @@
@interface RTCVideoSource (Internal)
@property(nonatomic, assign, readonly)
talk_base::scoped_refptr<webrtc::VideoSourceInterface>videoSource;
rtc::scoped_refptr<webrtc::VideoSourceInterface>videoSource;
@end

View File

@ -37,7 +37,7 @@
@implementation RTCVideoSource (Internal)
- (talk_base::scoped_refptr<webrtc::VideoSourceInterface>)videoSource {
- (rtc::scoped_refptr<webrtc::VideoSourceInterface>)videoSource {
return static_cast<webrtc::VideoSourceInterface*>(self.mediaSource.get());
}

View File

@ -35,6 +35,6 @@
@interface RTCVideoTrack (Internal)
@property(nonatomic, assign, readonly)
talk_base::scoped_refptr<webrtc::VideoTrackInterface> videoTrack;
rtc::scoped_refptr<webrtc::VideoTrackInterface> videoTrack;
@end

View File

@ -39,7 +39,7 @@
}
- (id)initWithMediaTrack:
(talk_base::scoped_refptr<webrtc::MediaStreamTrackInterface>)
(rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)
mediaTrack {
if (self = [super initWithMediaTrack:mediaTrack]) {
_rendererArray = [NSMutableArray array];
@ -71,7 +71,7 @@
@implementation RTCVideoTrack (Internal)
- (talk_base::scoped_refptr<webrtc::VideoTrackInterface>)videoTrack {
- (rtc::scoped_refptr<webrtc::VideoTrackInterface>)videoTrack {
return static_cast<webrtc::VideoTrackInterface*>(self.mediaTrack.get());
}

View File

@ -39,8 +39,8 @@
#import "RTCVideoRenderer.h"
#import "RTCVideoTrack.h"
#include "talk/base/gunit.h"
#include "talk/base/ssladapter.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/ssladapter.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
@ -299,7 +299,7 @@
// a TestBase since it's not.
TEST(RTCPeerConnectionTest, SessionTest) {
@autoreleasepool {
talk_base::InitializeSSL();
rtc::InitializeSSL();
// Since |factory| will own the signaling & worker threads, it's important
// that it outlive the created PeerConnections since they self-delete on the
// signaling thread, and if |factory| is freed first then a last refcount on
@ -312,6 +312,6 @@ TEST(RTCPeerConnectionTest, SessionTest) {
RTCPeerConnectionTest* pcTest = [[RTCPeerConnectionTest alloc] init];
[pcTest testCompleteSessionWithFactory:factory];
}
talk_base::CleanupSSL();
rtc::CleanupSSL();
}
}

View File

@ -25,7 +25,7 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "talk/base/gunit.h"
#include "webrtc/base/gunit.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."

View File

@ -35,8 +35,8 @@
#include "talk/app/webrtc/mediaconstraintsinterface.h"
#include "talk/app/webrtc/mediastreamhandler.h"
#include "talk/app/webrtc/streamcollection.h"
#include "talk/base/logging.h"
#include "talk/base/stringencode.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/stringencode.h"
#include "talk/p2p/client/basicportallocator.h"
#include "talk/session/media/channelmanager.h"
@ -74,22 +74,22 @@ enum {
MSG_GETSTATS,
};
struct SetSessionDescriptionMsg : public talk_base::MessageData {
struct SetSessionDescriptionMsg : public rtc::MessageData {
explicit SetSessionDescriptionMsg(
webrtc::SetSessionDescriptionObserver* observer)
: observer(observer) {
}
talk_base::scoped_refptr<webrtc::SetSessionDescriptionObserver> observer;
rtc::scoped_refptr<webrtc::SetSessionDescriptionObserver> observer;
std::string error;
};
struct GetStatsMsg : public talk_base::MessageData {
struct GetStatsMsg : public rtc::MessageData {
explicit GetStatsMsg(webrtc::StatsObserver* observer)
: observer(observer) {
}
webrtc::StatsReports reports;
talk_base::scoped_refptr<webrtc::StatsObserver> observer;
rtc::scoped_refptr<webrtc::StatsObserver> observer;
};
// |in_str| should be of format
@ -136,7 +136,7 @@ bool ParseHostnameAndPortFromString(const std::string& in_str,
*host = in_str.substr(1, closebracket - 1);
std::string::size_type colonpos = in_str.find(':', closebracket);
if (std::string::npos != colonpos) {
if (!talk_base::FromString(
if (!rtc::FromString(
in_str.substr(closebracket + 2, std::string::npos), port)) {
return false;
}
@ -148,7 +148,7 @@ bool ParseHostnameAndPortFromString(const std::string& in_str,
std::string::size_type colonpos = in_str.find(':');
if (std::string::npos != colonpos) {
*host = in_str.substr(0, colonpos);
if (!talk_base::FromString(
if (!rtc::FromString(
in_str.substr(colonpos + 1, std::string::npos), port)) {
return false;
}
@ -189,12 +189,12 @@ bool ParseIceServers(const PeerConnectionInterface::IceServers& configuration,
}
std::vector<std::string> tokens;
std::string turn_transport_type = kUdpTransportType;
talk_base::tokenize(server.uri, '?', &tokens);
rtc::tokenize(server.uri, '?', &tokens);
std::string uri_without_transport = tokens[0];
// Let's look into transport= param, if it exists.
if (tokens.size() == kTurnTransportTokensNum) { // ?transport= is present.
std::string uri_transport_param = tokens[1];
talk_base::tokenize(uri_transport_param, '=', &tokens);
rtc::tokenize(uri_transport_param, '=', &tokens);
if (tokens[0] == kTransport) {
// As per above grammar transport param will be consist of lower case
// letters.
@ -218,10 +218,10 @@ bool ParseIceServers(const PeerConnectionInterface::IceServers& configuration,
// Let's break hostname.
tokens.clear();
talk_base::tokenize(hoststring, '@', &tokens);
rtc::tokenize(hoststring, '@', &tokens);
hoststring = tokens[0];
if (tokens.size() == kTurnHostTokensNum) {
server.username = talk_base::s_url_decode(tokens[0]);
server.username = rtc::s_url_decode(tokens[0]);
hoststring = tokens[1];
}
@ -253,9 +253,9 @@ bool ParseIceServers(const PeerConnectionInterface::IceServers& configuration,
if (server.username.empty()) {
// Turn url example from the spec |url:"turn:user@turn.example.org"|.
std::vector<std::string> turn_tokens;
talk_base::tokenize(address, '@', &turn_tokens);
rtc::tokenize(address, '@', &turn_tokens);
if (turn_tokens.size() == kTurnHostTokensNum) {
server.username = talk_base::s_url_decode(turn_tokens[0]);
server.username = rtc::s_url_decode(turn_tokens[0]);
address = turn_tokens[1];
}
}
@ -387,12 +387,12 @@ bool PeerConnection::DoInitialize(
return true;
}
talk_base::scoped_refptr<StreamCollectionInterface>
rtc::scoped_refptr<StreamCollectionInterface>
PeerConnection::local_streams() {
return mediastream_signaling_->local_streams();
}
talk_base::scoped_refptr<StreamCollectionInterface>
rtc::scoped_refptr<StreamCollectionInterface>
PeerConnection::remote_streams() {
return mediastream_signaling_->remote_streams();
}
@ -423,7 +423,7 @@ void PeerConnection::RemoveStream(MediaStreamInterface* local_stream) {
observer_->OnRenegotiationNeeded();
}
talk_base::scoped_refptr<DtmfSenderInterface> PeerConnection::CreateDtmfSender(
rtc::scoped_refptr<DtmfSenderInterface> PeerConnection::CreateDtmfSender(
AudioTrackInterface* track) {
if (!track) {
LOG(LS_ERROR) << "CreateDtmfSender - track is NULL.";
@ -434,7 +434,7 @@ talk_base::scoped_refptr<DtmfSenderInterface> PeerConnection::CreateDtmfSender(
return NULL;
}
talk_base::scoped_refptr<DtmfSenderInterface> sender(
rtc::scoped_refptr<DtmfSenderInterface> sender(
DtmfSender::Create(track, signaling_thread(), session_.get()));
if (!sender.get()) {
LOG(LS_ERROR) << "CreateDtmfSender failed on DtmfSender::Create.";
@ -452,7 +452,7 @@ bool PeerConnection::GetStats(StatsObserver* observer,
}
stats_->UpdateStats(level);
talk_base::scoped_ptr<GetStatsMsg> msg(new GetStatsMsg(observer));
rtc::scoped_ptr<GetStatsMsg> msg(new GetStatsMsg(observer));
if (!stats_->GetStats(track, &(msg->reports))) {
return false;
}
@ -478,17 +478,17 @@ PeerConnection::ice_gathering_state() {
return ice_gathering_state_;
}
talk_base::scoped_refptr<DataChannelInterface>
rtc::scoped_refptr<DataChannelInterface>
PeerConnection::CreateDataChannel(
const std::string& label,
const DataChannelInit* config) {
bool first_datachannel = !mediastream_signaling_->HasDataChannels();
talk_base::scoped_ptr<InternalDataChannelInit> internal_config;
rtc::scoped_ptr<InternalDataChannelInit> internal_config;
if (config) {
internal_config.reset(new InternalDataChannelInit(*config));
}
talk_base::scoped_refptr<DataChannelInterface> channel(
rtc::scoped_refptr<DataChannelInterface> channel(
session_->CreateDataChannel(label, internal_config.get()));
if (!channel.get())
return NULL;
@ -588,13 +588,13 @@ bool PeerConnection::UpdateIce(const RTCConfiguration& config) {
return false;
}
std::vector<talk_base::SocketAddress> stun_hosts;
std::vector<rtc::SocketAddress> stun_hosts;
typedef std::vector<StunConfiguration>::const_iterator StunIt;
for (StunIt stun_it = stuns.begin(); stun_it != stuns.end(); ++stun_it) {
stun_hosts.push_back(stun_it->server);
}
talk_base::SocketAddress stun_addr;
rtc::SocketAddress stun_addr;
if (!stun_hosts.empty()) {
stun_addr = stun_hosts.front();
LOG(LS_INFO) << "UpdateIce: StunServer Address: " << stun_addr.ToString();
@ -684,7 +684,7 @@ void PeerConnection::OnSessionStateChange(cricket::BaseSession* /*session*/,
}
}
void PeerConnection::OnMessage(talk_base::Message* msg) {
void PeerConnection::OnMessage(rtc::Message* msg) {
switch (msg->message_id) {
case MSG_SET_SESSIONDESCRIPTION_SUCCESS: {
SetSessionDescriptionMsg* param =

View File

@ -36,7 +36,7 @@
#include "talk/app/webrtc/statscollector.h"
#include "talk/app/webrtc/streamcollection.h"
#include "talk/app/webrtc/webrtcsession.h"
#include "talk/base/scoped_ptr.h"
#include "webrtc/base/scoped_ptr.h"
namespace webrtc {
class MediaStreamHandlerContainer;
@ -52,7 +52,7 @@ typedef std::vector<PortAllocatorFactoryInterface::TurnConfiguration>
class PeerConnection : public PeerConnectionInterface,
public MediaStreamSignalingObserver,
public IceObserver,
public talk_base::MessageHandler,
public rtc::MessageHandler,
public sigslot::has_slots<> {
public:
explicit PeerConnection(PeerConnectionFactory* factory);
@ -63,16 +63,16 @@ class PeerConnection : public PeerConnectionInterface,
PortAllocatorFactoryInterface* allocator_factory,
DTLSIdentityServiceInterface* dtls_identity_service,
PeerConnectionObserver* observer);
virtual talk_base::scoped_refptr<StreamCollectionInterface> local_streams();
virtual talk_base::scoped_refptr<StreamCollectionInterface> remote_streams();
virtual rtc::scoped_refptr<StreamCollectionInterface> local_streams();
virtual rtc::scoped_refptr<StreamCollectionInterface> remote_streams();
virtual bool AddStream(MediaStreamInterface* local_stream,
const MediaConstraintsInterface* constraints);
virtual void RemoveStream(MediaStreamInterface* local_stream);
virtual talk_base::scoped_refptr<DtmfSenderInterface> CreateDtmfSender(
virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender(
AudioTrackInterface* track);
virtual talk_base::scoped_refptr<DataChannelInterface> CreateDataChannel(
virtual rtc::scoped_refptr<DataChannelInterface> CreateDataChannel(
const std::string& label,
const DataChannelInit* config);
virtual bool GetStats(StatsObserver* observer,
@ -114,7 +114,7 @@ class PeerConnection : public PeerConnectionInterface,
private:
// Implements MessageHandler.
virtual void OnMessage(talk_base::Message* msg);
virtual void OnMessage(rtc::Message* msg);
// Implements MediaStreamSignalingObserver.
virtual void OnAddRemoteStream(MediaStreamInterface* stream) OVERRIDE;
@ -166,7 +166,7 @@ class PeerConnection : public PeerConnectionInterface,
DTLSIdentityServiceInterface* dtls_identity_service,
PeerConnectionObserver* observer);
talk_base::Thread* signaling_thread() const {
rtc::Thread* signaling_thread() const {
return factory_->signaling_thread();
}
@ -183,7 +183,7 @@ class PeerConnection : public PeerConnectionInterface,
// However, since the reference counting is done in the
// PeerConnectionFactoryInteface all instances created using the raw pointer
// will refer to the same reference count.
talk_base::scoped_refptr<PeerConnectionFactory> factory_;
rtc::scoped_refptr<PeerConnectionFactory> factory_;
PeerConnectionObserver* observer_;
UMAObserver* uma_observer_;
SignalingState signaling_state_;
@ -192,11 +192,11 @@ class PeerConnection : public PeerConnectionInterface,
IceConnectionState ice_connection_state_;
IceGatheringState ice_gathering_state_;
talk_base::scoped_ptr<cricket::PortAllocator> port_allocator_;
talk_base::scoped_ptr<WebRtcSession> session_;
talk_base::scoped_ptr<MediaStreamSignaling> mediastream_signaling_;
talk_base::scoped_ptr<MediaStreamHandlerContainer> stream_handler_container_;
talk_base::scoped_ptr<StatsCollector> stats_;
rtc::scoped_ptr<cricket::PortAllocator> port_allocator_;
rtc::scoped_ptr<WebRtcSession> session_;
rtc::scoped_ptr<MediaStreamSignaling> mediastream_signaling_;
rtc::scoped_ptr<MediaStreamHandlerContainer> stream_handler_container_;
rtc::scoped_ptr<StatsCollector> stats_;
};
} // namespace webrtc

View File

@ -45,11 +45,11 @@
#include "talk/app/webrtc/test/fakeperiodicvideocapturer.h"
#include "talk/app/webrtc/test/mockpeerconnectionobservers.h"
#include "talk/app/webrtc/videosourceinterface.h"
#include "talk/base/gunit.h"
#include "talk/base/scoped_ptr.h"
#include "talk/base/ssladapter.h"
#include "talk/base/sslstreamadapter.h"
#include "talk/base/thread.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/ssladapter.h"
#include "webrtc/base/sslstreamadapter.h"
#include "webrtc/base/thread.h"
#include "talk/media/webrtc/fakewebrtcvideoengine.h"
#include "talk/p2p/base/constants.h"
#include "talk/p2p/base/sessiondescription.h"
@ -155,9 +155,9 @@ class PeerConnectionTestClientBase
void AddMediaStream(bool audio, bool video) {
std::string label = kStreamLabelBase +
talk_base::ToString<int>(
rtc::ToString<int>(
static_cast<int>(peer_connection_->local_streams()->count()));
talk_base::scoped_refptr<webrtc::MediaStreamInterface> stream =
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream =
peer_connection_factory_->CreateLocalMediaStream(label);
if (audio && can_receive_audio()) {
@ -165,11 +165,11 @@ class PeerConnectionTestClientBase
// Disable highpass filter so that we can get all the test audio frames.
constraints.AddMandatory(
MediaConstraintsInterface::kHighpassFilter, false);
talk_base::scoped_refptr<webrtc::AudioSourceInterface> source =
rtc::scoped_refptr<webrtc::AudioSourceInterface> source =
peer_connection_factory_->CreateAudioSource(&constraints);
// TODO(perkj): Test audio source when it is implemented. Currently audio
// always use the default input.
talk_base::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
peer_connection_factory_->CreateAudioTrack(kAudioTrackLabelBase,
source));
stream->AddTrack(audio_track);
@ -236,13 +236,13 @@ class PeerConnectionTestClientBase
}
// Verify the CreateDtmfSender interface
void VerifyDtmf() {
talk_base::scoped_ptr<DummyDtmfObserver> observer(new DummyDtmfObserver());
talk_base::scoped_refptr<DtmfSenderInterface> dtmf_sender;
rtc::scoped_ptr<DummyDtmfObserver> observer(new DummyDtmfObserver());
rtc::scoped_refptr<DtmfSenderInterface> dtmf_sender;
// We can't create a DTMF sender with an invalid audio track or a non local
// track.
EXPECT_TRUE(peer_connection_->CreateDtmfSender(NULL) == NULL);
talk_base::scoped_refptr<webrtc::AudioTrackInterface> non_localtrack(
rtc::scoped_refptr<webrtc::AudioTrackInterface> non_localtrack(
peer_connection_factory_->CreateAudioTrack("dummy_track",
NULL));
EXPECT_TRUE(peer_connection_->CreateDtmfSender(non_localtrack) == NULL);
@ -333,8 +333,8 @@ class PeerConnectionTestClientBase
}
int GetAudioOutputLevelStats(webrtc::MediaStreamTrackInterface* track) {
talk_base::scoped_refptr<MockStatsObserver>
observer(new talk_base::RefCountedObject<MockStatsObserver>());
rtc::scoped_refptr<MockStatsObserver>
observer(new rtc::RefCountedObject<MockStatsObserver>());
EXPECT_TRUE(peer_connection_->GetStats(
observer, track, PeerConnectionInterface::kStatsOutputLevelStandard));
EXPECT_TRUE_WAIT(observer->called(), kMaxWaitMs);
@ -342,8 +342,8 @@ class PeerConnectionTestClientBase
}
int GetAudioInputLevelStats() {
talk_base::scoped_refptr<MockStatsObserver>
observer(new talk_base::RefCountedObject<MockStatsObserver>());
rtc::scoped_refptr<MockStatsObserver>
observer(new rtc::RefCountedObject<MockStatsObserver>());
EXPECT_TRUE(peer_connection_->GetStats(
observer, NULL, PeerConnectionInterface::kStatsOutputLevelStandard));
EXPECT_TRUE_WAIT(observer->called(), kMaxWaitMs);
@ -351,8 +351,8 @@ class PeerConnectionTestClientBase
}
int GetBytesReceivedStats(webrtc::MediaStreamTrackInterface* track) {
talk_base::scoped_refptr<MockStatsObserver>
observer(new talk_base::RefCountedObject<MockStatsObserver>());
rtc::scoped_refptr<MockStatsObserver>
observer(new rtc::RefCountedObject<MockStatsObserver>());
EXPECT_TRUE(peer_connection_->GetStats(
observer, track, PeerConnectionInterface::kStatsOutputLevelStandard));
EXPECT_TRUE_WAIT(observer->called(), kMaxWaitMs);
@ -360,8 +360,8 @@ class PeerConnectionTestClientBase
}
int GetBytesSentStats(webrtc::MediaStreamTrackInterface* track) {
talk_base::scoped_refptr<MockStatsObserver>
observer(new talk_base::RefCountedObject<MockStatsObserver>());
rtc::scoped_refptr<MockStatsObserver>
observer(new rtc::RefCountedObject<MockStatsObserver>());
EXPECT_TRUE(peer_connection_->GetStats(
observer, track, PeerConnectionInterface::kStatsOutputLevelStandard));
EXPECT_TRUE_WAIT(observer->called(), kMaxWaitMs);
@ -474,7 +474,7 @@ class PeerConnectionTestClientBase
fake_video_decoder_factory_ = new FakeWebRtcVideoDecoderFactory();
fake_video_encoder_factory_ = new FakeWebRtcVideoEncoderFactory();
peer_connection_factory_ = webrtc::CreatePeerConnectionFactory(
talk_base::Thread::Current(), talk_base::Thread::Current(),
rtc::Thread::Current(), rtc::Thread::Current(),
fake_audio_capture_module_, fake_video_encoder_factory_,
fake_video_decoder_factory_);
if (!peer_connection_factory_) {
@ -484,7 +484,7 @@ class PeerConnectionTestClientBase
constraints);
return peer_connection_.get() != NULL;
}
virtual talk_base::scoped_refptr<webrtc::PeerConnectionInterface>
virtual rtc::scoped_refptr<webrtc::PeerConnectionInterface>
CreatePeerConnection(webrtc::PortAllocatorFactoryInterface* factory,
const MediaConstraintsInterface* constraints) = 0;
MessageReceiver* signaling_message_receiver() {
@ -523,13 +523,13 @@ class PeerConnectionTestClientBase
std::vector<std::string> tones_;
};
talk_base::scoped_refptr<webrtc::VideoTrackInterface>
rtc::scoped_refptr<webrtc::VideoTrackInterface>
CreateLocalVideoTrack(const std::string stream_label) {
// Set max frame rate to 10fps to reduce the risk of the tests to be flaky.
FakeConstraints source_constraints = video_constraints_;
source_constraints.SetMandatoryMaxFrameRate(10);
talk_base::scoped_refptr<webrtc::VideoSourceInterface> source =
rtc::scoped_refptr<webrtc::VideoSourceInterface> source =
peer_connection_factory_->CreateVideoSource(
new webrtc::FakePeriodicVideoCapturer(),
&source_constraints);
@ -543,12 +543,12 @@ class PeerConnectionTestClientBase
// signaling time constraints and relative complexity of the audio pipeline.
// This is consistent with the video pipeline that us a a separate thread for
// encoding and decoding.
talk_base::Thread audio_thread_;
rtc::Thread audio_thread_;
talk_base::scoped_refptr<webrtc::PortAllocatorFactoryInterface>
rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface>
allocator_factory_;
talk_base::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
talk_base::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
peer_connection_factory_;
typedef std::pair<std::string, std::string> IceUfragPwdPair;
@ -556,7 +556,7 @@ class PeerConnectionTestClientBase
bool expect_ice_restart_;
// Needed to keep track of number of frames send.
talk_base::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
// Needed to keep track of number of frames received.
typedef std::map<std::string, webrtc::FakeVideoTrackRenderer*> RenderMap;
RenderMap fake_video_renderers_;
@ -590,7 +590,7 @@ class JsepTestClient
Negotiate(true, true);
}
virtual void Negotiate(bool audio, bool video) {
talk_base::scoped_ptr<SessionDescriptionInterface> offer;
rtc::scoped_ptr<SessionDescriptionInterface> offer;
EXPECT_TRUE(DoCreateOffer(offer.use()));
if (offer->description()->GetContentByName("audio")) {
@ -621,7 +621,7 @@ class JsepTestClient
int sdp_mline_index,
const std::string& msg) {
LOG(INFO) << id() << "ReceiveIceMessage";
talk_base::scoped_ptr<webrtc::IceCandidateInterface> candidate(
rtc::scoped_ptr<webrtc::IceCandidateInterface> candidate(
webrtc::CreateIceCandidate(sdp_mid, sdp_mline_index, msg, NULL));
EXPECT_TRUE(pc()->AddIceCandidate(candidate.get()));
}
@ -723,7 +723,7 @@ class JsepTestClient
remove_sdes_(false) {
}
virtual talk_base::scoped_refptr<webrtc::PeerConnectionInterface>
virtual rtc::scoped_refptr<webrtc::PeerConnectionInterface>
CreatePeerConnection(webrtc::PortAllocatorFactoryInterface* factory,
const MediaConstraintsInterface* constraints) {
// CreatePeerConnection with IceServers.
@ -733,7 +733,7 @@ class JsepTestClient
ice_servers.push_back(ice_server);
FakeIdentityService* dtls_service =
talk_base::SSLStreamAdapter::HaveDtlsSrtp() ?
rtc::SSLStreamAdapter::HaveDtlsSrtp() ?
new FakeIdentityService() : NULL;
return peer_connection_factory()->CreatePeerConnection(
ice_servers, constraints, factory, dtls_service, this);
@ -745,10 +745,10 @@ class JsepTestClient
// If we are not sending any streams ourselves it is time to add some.
AddMediaStream(true, true);
}
talk_base::scoped_ptr<SessionDescriptionInterface> desc(
rtc::scoped_ptr<SessionDescriptionInterface> desc(
webrtc::CreateSessionDescription("offer", msg, NULL));
EXPECT_TRUE(DoSetRemoteDescription(desc.release()));
talk_base::scoped_ptr<SessionDescriptionInterface> answer;
rtc::scoped_ptr<SessionDescriptionInterface> answer;
EXPECT_TRUE(DoCreateAnswer(answer.use()));
std::string sdp;
EXPECT_TRUE(answer->ToString(&sdp));
@ -761,15 +761,15 @@ class JsepTestClient
void HandleIncomingAnswer(const std::string& msg) {
LOG(INFO) << id() << "HandleIncomingAnswer";
talk_base::scoped_ptr<SessionDescriptionInterface> desc(
rtc::scoped_ptr<SessionDescriptionInterface> desc(
webrtc::CreateSessionDescription("answer", msg, NULL));
EXPECT_TRUE(DoSetRemoteDescription(desc.release()));
}
bool DoCreateOfferAnswer(SessionDescriptionInterface** desc,
bool offer) {
talk_base::scoped_refptr<MockCreateSessionDescriptionObserver>
observer(new talk_base::RefCountedObject<
rtc::scoped_refptr<MockCreateSessionDescriptionObserver>
observer(new rtc::RefCountedObject<
MockCreateSessionDescriptionObserver>());
if (offer) {
pc()->CreateOffer(observer, &session_description_constraints_);
@ -793,8 +793,8 @@ class JsepTestClient
}
bool DoSetLocalDescription(SessionDescriptionInterface* desc) {
talk_base::scoped_refptr<MockSetSessionDescriptionObserver>
observer(new talk_base::RefCountedObject<
rtc::scoped_refptr<MockSetSessionDescriptionObserver>
observer(new rtc::RefCountedObject<
MockSetSessionDescriptionObserver>());
LOG(INFO) << id() << "SetLocalDescription ";
pc()->SetLocalDescription(observer, desc);
@ -802,7 +802,7 @@ class JsepTestClient
// EXPECT_TRUE_WAIT, local ice candidates might be sent to the remote peer
// before the offer which is an error.
// The reason is that EXPECT_TRUE_WAIT uses
// talk_base::Thread::Current()->ProcessMessages(1);
// rtc::Thread::Current()->ProcessMessages(1);
// ProcessMessages waits at least 1ms but processes all messages before
// returning. Since this test is synchronous and send messages to the remote
// peer whenever a callback is invoked, this can lead to messages being
@ -814,8 +814,8 @@ class JsepTestClient
}
bool DoSetRemoteDescription(SessionDescriptionInterface* desc) {
talk_base::scoped_refptr<MockSetSessionDescriptionObserver>
observer(new talk_base::RefCountedObject<
rtc::scoped_refptr<MockSetSessionDescriptionObserver>
observer(new rtc::RefCountedObject<
MockSetSessionDescriptionObserver>());
LOG(INFO) << id() << "SetRemoteDescription ";
pc()->SetRemoteDescription(observer, desc);
@ -847,8 +847,8 @@ class JsepTestClient
bool remove_bundle_; // True if bundle should be removed in received SDP.
bool remove_sdes_; // True if a=crypto should be removed in received SDP.
talk_base::scoped_refptr<DataChannelInterface> data_channel_;
talk_base::scoped_ptr<MockDataChannelObserver> data_observer_;
rtc::scoped_refptr<DataChannelInterface> data_channel_;
rtc::scoped_ptr<MockDataChannelObserver> data_observer_;
};
template <typename SignalingClass>
@ -904,7 +904,7 @@ class P2PTestConductor : public testing::Test {
}
P2PTestConductor() {
talk_base::InitializeSSL(NULL);
rtc::InitializeSSL(NULL);
}
~P2PTestConductor() {
if (initiating_client_) {
@ -913,7 +913,7 @@ class P2PTestConductor : public testing::Test {
if (receiving_client_) {
receiving_client_->set_signaling_message_receiver(NULL);
}
talk_base::CleanupSSL();
rtc::CleanupSSL();
}
bool CreateTestClients() {
@ -1023,8 +1023,8 @@ class P2PTestConductor : public testing::Test {
SignalingClass* receiving_client() { return receiving_client_.get(); }
private:
talk_base::scoped_ptr<SignalingClass> initiating_client_;
talk_base::scoped_ptr<SignalingClass> receiving_client_;
rtc::scoped_ptr<SignalingClass> initiating_client_;
rtc::scoped_ptr<SignalingClass> receiving_client_;
};
typedef P2PTestConductor<JsepTestClient> JsepPeerConnectionP2PTestClient;
@ -1081,7 +1081,7 @@ TEST_F(JsepPeerConnectionP2PTestClient, DISABLED_LocalP2PTest1280By720) {
// This test sets up a call between two endpoints that are configured to use
// DTLS key agreement. As a result, DTLS is negotiated and used for transport.
TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestDtls) {
MAYBE_SKIP_TEST(talk_base::SSLStreamAdapter::HaveDtlsSrtp);
MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp);
FakeConstraints setup_constraints;
setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp,
true);
@ -1093,7 +1093,7 @@ TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestDtls) {
// This test sets up a audio call initially and then upgrades to audio/video,
// using DTLS.
TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestDtlsRenegotiate) {
MAYBE_SKIP_TEST(talk_base::SSLStreamAdapter::HaveDtlsSrtp);
MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp);
FakeConstraints setup_constraints;
setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp,
true);
@ -1108,7 +1108,7 @@ TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestDtlsRenegotiate) {
// DTLS key agreement. The offerer don't support SDES. As a result, DTLS is
// negotiated and used for transport.
TEST_F(JsepPeerConnectionP2PTestClient, LocalP2PTestOfferDtlsButNotSdes) {
MAYBE_SKIP_TEST(talk_base::SSLStreamAdapter::HaveDtlsSrtp);
MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp);
FakeConstraints setup_constraints;
setup_constraints.AddMandatory(MediaConstraintsInterface::kEnableDtlsSrtp,
true);
@ -1320,7 +1320,7 @@ TEST_F(JsepPeerConnectionP2PTestClient, RegisterDataChannelObserver) {
// Wait a while to allow the sent data to arrive before an observer is
// registered..
talk_base::Thread::Current()->ProcessMessages(100);
rtc::Thread::Current()->ProcessMessages(100);
MockDataChannelObserver new_observer(receiving_client()->data_channel());
EXPECT_EQ_WAIT(data, new_observer.last_message(), kMaxWaitMs);
@ -1367,7 +1367,7 @@ TEST_F(JsepPeerConnectionP2PTestClient, AddDataChannelAfterRenegotiation) {
// negotiation is completed without error.
#ifdef HAVE_SCTP
TEST_F(JsepPeerConnectionP2PTestClient, CreateOfferWithSctpDataChannel) {
MAYBE_SKIP_TEST(talk_base::SSLStreamAdapter::HaveDtlsSrtp);
MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp);
FakeConstraints constraints;
constraints.SetMandatory(
MediaConstraintsInterface::kEnableDtlsSrtp, true);

View File

@ -27,12 +27,12 @@
#include "talk/app/webrtc/test/peerconnectiontestwrapper.h"
#include "talk/app/webrtc/test/mockpeerconnectionobservers.h"
#include "talk/base/gunit.h"
#include "talk/base/logging.h"
#include "talk/base/ssladapter.h"
#include "talk/base/sslstreamadapter.h"
#include "talk/base/stringencode.h"
#include "talk/base/stringutils.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/ssladapter.h"
#include "webrtc/base/sslstreamadapter.h"
#include "webrtc/base/stringencode.h"
#include "webrtc/base/stringutils.h"
#define MAYBE_SKIP_TEST(feature) \
if (!(feature())) { \
@ -68,14 +68,14 @@ void InjectAfter(const std::string& line,
const std::string& newlines,
std::string* message) {
const std::string tmp = line + newlines;
talk_base::replace_substrs(line.c_str(), line.length(),
rtc::replace_substrs(line.c_str(), line.length(),
tmp.c_str(), tmp.length(), message);
}
void Replace(const std::string& line,
const std::string& newlines,
std::string* message) {
talk_base::replace_substrs(line.c_str(), line.length(),
rtc::replace_substrs(line.c_str(), line.length(),
newlines.c_str(), newlines.length(), message);
}
@ -126,15 +126,15 @@ class PeerConnectionEndToEndTest
: public sigslot::has_slots<>,
public testing::Test {
public:
typedef std::vector<talk_base::scoped_refptr<DataChannelInterface> >
typedef std::vector<rtc::scoped_refptr<DataChannelInterface> >
DataChannelList;
PeerConnectionEndToEndTest()
: caller_(new talk_base::RefCountedObject<PeerConnectionTestWrapper>(
: caller_(new rtc::RefCountedObject<PeerConnectionTestWrapper>(
"caller")),
callee_(new talk_base::RefCountedObject<PeerConnectionTestWrapper>(
callee_(new rtc::RefCountedObject<PeerConnectionTestWrapper>(
"callee")) {
talk_base::InitializeSSL(NULL);
rtc::InitializeSSL(NULL);
}
void CreatePcs() {
@ -222,10 +222,10 @@ class PeerConnectionEndToEndTest
// Tests that |dc1| and |dc2| can send to and receive from each other.
void TestDataChannelSendAndReceive(
DataChannelInterface* dc1, DataChannelInterface* dc2) {
talk_base::scoped_ptr<webrtc::MockDataChannelObserver> dc1_observer(
rtc::scoped_ptr<webrtc::MockDataChannelObserver> dc1_observer(
new webrtc::MockDataChannelObserver(dc1));
talk_base::scoped_ptr<webrtc::MockDataChannelObserver> dc2_observer(
rtc::scoped_ptr<webrtc::MockDataChannelObserver> dc2_observer(
new webrtc::MockDataChannelObserver(dc2));
static const std::string kDummyData = "abcdefg";
@ -263,12 +263,12 @@ class PeerConnectionEndToEndTest
}
~PeerConnectionEndToEndTest() {
talk_base::CleanupSSL();
rtc::CleanupSSL();
}
protected:
talk_base::scoped_refptr<PeerConnectionTestWrapper> caller_;
talk_base::scoped_refptr<PeerConnectionTestWrapper> callee_;
rtc::scoped_refptr<PeerConnectionTestWrapper> caller_;
rtc::scoped_refptr<PeerConnectionTestWrapper> callee_;
DataChannelList caller_signaled_data_channels_;
DataChannelList callee_signaled_data_channels_;
};
@ -300,14 +300,14 @@ TEST_F(PeerConnectionEndToEndTest, DISABLED_CallWithLegacySdp) {
// Verifies that a DataChannel created before the negotiation can transition to
// "OPEN" and transfer data.
TEST_F(PeerConnectionEndToEndTest, CreateDataChannelBeforeNegotiate) {
MAYBE_SKIP_TEST(talk_base::SSLStreamAdapter::HaveDtlsSrtp);
MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp);
CreatePcs();
webrtc::DataChannelInit init;
talk_base::scoped_refptr<DataChannelInterface> caller_dc(
rtc::scoped_refptr<DataChannelInterface> caller_dc(
caller_->CreateDataChannel("data", init));
talk_base::scoped_refptr<DataChannelInterface> callee_dc(
rtc::scoped_refptr<DataChannelInterface> callee_dc(
callee_->CreateDataChannel("data", init));
Negotiate();
@ -326,22 +326,22 @@ TEST_F(PeerConnectionEndToEndTest, CreateDataChannelBeforeNegotiate) {
// Verifies that a DataChannel created after the negotiation can transition to
// "OPEN" and transfer data.
TEST_F(PeerConnectionEndToEndTest, CreateDataChannelAfterNegotiate) {
MAYBE_SKIP_TEST(talk_base::SSLStreamAdapter::HaveDtlsSrtp);
MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp);
CreatePcs();
webrtc::DataChannelInit init;
// This DataChannel is for creating the data content in the negotiation.
talk_base::scoped_refptr<DataChannelInterface> dummy(
rtc::scoped_refptr<DataChannelInterface> dummy(
caller_->CreateDataChannel("data", init));
Negotiate();
WaitForConnection();
// Creates new DataChannels after the negotiation and verifies their states.
talk_base::scoped_refptr<DataChannelInterface> caller_dc(
rtc::scoped_refptr<DataChannelInterface> caller_dc(
caller_->CreateDataChannel("hello", init));
talk_base::scoped_refptr<DataChannelInterface> callee_dc(
rtc::scoped_refptr<DataChannelInterface> callee_dc(
callee_->CreateDataChannel("hello", init));
WaitForDataChannelsToOpen(caller_dc, callee_signaled_data_channels_, 1);
@ -356,14 +356,14 @@ TEST_F(PeerConnectionEndToEndTest, CreateDataChannelAfterNegotiate) {
// Verifies that DataChannel IDs are even/odd based on the DTLS roles.
TEST_F(PeerConnectionEndToEndTest, DataChannelIdAssignment) {
MAYBE_SKIP_TEST(talk_base::SSLStreamAdapter::HaveDtlsSrtp);
MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp);
CreatePcs();
webrtc::DataChannelInit init;
talk_base::scoped_refptr<DataChannelInterface> caller_dc_1(
rtc::scoped_refptr<DataChannelInterface> caller_dc_1(
caller_->CreateDataChannel("data", init));
talk_base::scoped_refptr<DataChannelInterface> callee_dc_1(
rtc::scoped_refptr<DataChannelInterface> callee_dc_1(
callee_->CreateDataChannel("data", init));
Negotiate();
@ -372,9 +372,9 @@ TEST_F(PeerConnectionEndToEndTest, DataChannelIdAssignment) {
EXPECT_EQ(1U, caller_dc_1->id() % 2);
EXPECT_EQ(0U, callee_dc_1->id() % 2);
talk_base::scoped_refptr<DataChannelInterface> caller_dc_2(
rtc::scoped_refptr<DataChannelInterface> caller_dc_2(
caller_->CreateDataChannel("data", init));
talk_base::scoped_refptr<DataChannelInterface> callee_dc_2(
rtc::scoped_refptr<DataChannelInterface> callee_dc_2(
callee_->CreateDataChannel("data", init));
EXPECT_EQ(1U, caller_dc_2->id() % 2);
@ -385,15 +385,15 @@ TEST_F(PeerConnectionEndToEndTest, DataChannelIdAssignment) {
// there are multiple DataChannels.
TEST_F(PeerConnectionEndToEndTest,
MessageTransferBetweenTwoPairsOfDataChannels) {
MAYBE_SKIP_TEST(talk_base::SSLStreamAdapter::HaveDtlsSrtp);
MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp);
CreatePcs();
webrtc::DataChannelInit init;
talk_base::scoped_refptr<DataChannelInterface> caller_dc_1(
rtc::scoped_refptr<DataChannelInterface> caller_dc_1(
caller_->CreateDataChannel("data", init));
talk_base::scoped_refptr<DataChannelInterface> caller_dc_2(
rtc::scoped_refptr<DataChannelInterface> caller_dc_2(
caller_->CreateDataChannel("data", init));
Negotiate();
@ -401,10 +401,10 @@ TEST_F(PeerConnectionEndToEndTest,
WaitForDataChannelsToOpen(caller_dc_1, callee_signaled_data_channels_, 0);
WaitForDataChannelsToOpen(caller_dc_2, callee_signaled_data_channels_, 1);
talk_base::scoped_ptr<webrtc::MockDataChannelObserver> dc_1_observer(
rtc::scoped_ptr<webrtc::MockDataChannelObserver> dc_1_observer(
new webrtc::MockDataChannelObserver(callee_signaled_data_channels_[0]));
talk_base::scoped_ptr<webrtc::MockDataChannelObserver> dc_2_observer(
rtc::scoped_ptr<webrtc::MockDataChannelObserver> dc_2_observer(
new webrtc::MockDataChannelObserver(callee_signaled_data_channels_[1]));
const std::string message_1 = "hello 1";

View File

@ -43,13 +43,13 @@
#include "talk/media/webrtc/webrtcvideoencoderfactory.h"
#include "webrtc/modules/audio_device/include/audio_device.h"
using talk_base::scoped_refptr;
using rtc::scoped_refptr;
namespace {
typedef talk_base::TypedMessageData<bool> InitMessageData;
typedef rtc::TypedMessageData<bool> InitMessageData;
struct CreatePeerConnectionParams : public talk_base::MessageData {
struct CreatePeerConnectionParams : public rtc::MessageData {
CreatePeerConnectionParams(
const webrtc::PeerConnectionInterface::RTCConfiguration& configuration,
const webrtc::MediaConstraintsInterface* constraints,
@ -70,7 +70,7 @@ struct CreatePeerConnectionParams : public talk_base::MessageData {
webrtc::PeerConnectionObserver* observer;
};
struct CreateAudioSourceParams : public talk_base::MessageData {
struct CreateAudioSourceParams : public rtc::MessageData {
explicit CreateAudioSourceParams(
const webrtc::MediaConstraintsInterface* constraints)
: constraints(constraints) {
@ -79,7 +79,7 @@ struct CreateAudioSourceParams : public talk_base::MessageData {
scoped_refptr<webrtc::AudioSourceInterface> source;
};
struct CreateVideoSourceParams : public talk_base::MessageData {
struct CreateVideoSourceParams : public rtc::MessageData {
CreateVideoSourceParams(cricket::VideoCapturer* capturer,
const webrtc::MediaConstraintsInterface* constraints)
: capturer(capturer),
@ -90,11 +90,11 @@ struct CreateVideoSourceParams : public talk_base::MessageData {
scoped_refptr<webrtc::VideoSourceInterface> source;
};
struct StartAecDumpParams : public talk_base::MessageData {
explicit StartAecDumpParams(talk_base::PlatformFile aec_dump_file)
struct StartAecDumpParams : public rtc::MessageData {
explicit StartAecDumpParams(rtc::PlatformFile aec_dump_file)
: aec_dump_file(aec_dump_file) {
}
talk_base::PlatformFile aec_dump_file;
rtc::PlatformFile aec_dump_file;
bool result;
};
@ -111,10 +111,10 @@ enum {
namespace webrtc {
talk_base::scoped_refptr<PeerConnectionFactoryInterface>
rtc::scoped_refptr<PeerConnectionFactoryInterface>
CreatePeerConnectionFactory() {
talk_base::scoped_refptr<PeerConnectionFactory> pc_factory(
new talk_base::RefCountedObject<PeerConnectionFactory>());
rtc::scoped_refptr<PeerConnectionFactory> pc_factory(
new rtc::RefCountedObject<PeerConnectionFactory>());
if (!pc_factory->Initialize()) {
return NULL;
@ -122,15 +122,15 @@ CreatePeerConnectionFactory() {
return pc_factory;
}
talk_base::scoped_refptr<PeerConnectionFactoryInterface>
rtc::scoped_refptr<PeerConnectionFactoryInterface>
CreatePeerConnectionFactory(
talk_base::Thread* worker_thread,
talk_base::Thread* signaling_thread,
rtc::Thread* worker_thread,
rtc::Thread* signaling_thread,
AudioDeviceModule* default_adm,
cricket::WebRtcVideoEncoderFactory* encoder_factory,
cricket::WebRtcVideoDecoderFactory* decoder_factory) {
talk_base::scoped_refptr<PeerConnectionFactory> pc_factory(
new talk_base::RefCountedObject<PeerConnectionFactory>(worker_thread,
rtc::scoped_refptr<PeerConnectionFactory> pc_factory(
new rtc::RefCountedObject<PeerConnectionFactory>(worker_thread,
signaling_thread,
default_adm,
encoder_factory,
@ -143,8 +143,8 @@ CreatePeerConnectionFactory(
PeerConnectionFactory::PeerConnectionFactory()
: owns_ptrs_(true),
signaling_thread_(new talk_base::Thread),
worker_thread_(new talk_base::Thread) {
signaling_thread_(new rtc::Thread),
worker_thread_(new rtc::Thread) {
bool result = signaling_thread_->Start();
ASSERT(result);
result = worker_thread_->Start();
@ -152,8 +152,8 @@ PeerConnectionFactory::PeerConnectionFactory()
}
PeerConnectionFactory::PeerConnectionFactory(
talk_base::Thread* worker_thread,
talk_base::Thread* signaling_thread,
rtc::Thread* worker_thread,
rtc::Thread* signaling_thread,
AudioDeviceModule* default_adm,
cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
cricket::WebRtcVideoDecoderFactory* video_decoder_factory)
@ -185,7 +185,7 @@ bool PeerConnectionFactory::Initialize() {
return result.data();
}
void PeerConnectionFactory::OnMessage(talk_base::Message* msg) {
void PeerConnectionFactory::OnMessage(rtc::Message* msg) {
switch (msg->message_id) {
case MSG_INIT_FACTORY: {
InitMessageData* pdata = static_cast<InitMessageData*>(msg->pdata);
@ -229,7 +229,7 @@ void PeerConnectionFactory::OnMessage(talk_base::Message* msg) {
}
bool PeerConnectionFactory::Initialize_s() {
talk_base::InitRandom(talk_base::Time());
rtc::InitRandom(rtc::Time());
allocator_factory_ = PortAllocatorFactory::Create(worker_thread_);
if (!allocator_factory_)
@ -260,28 +260,28 @@ void PeerConnectionFactory::Terminate_s() {
allocator_factory_ = NULL;
}
talk_base::scoped_refptr<AudioSourceInterface>
rtc::scoped_refptr<AudioSourceInterface>
PeerConnectionFactory::CreateAudioSource_s(
const MediaConstraintsInterface* constraints) {
talk_base::scoped_refptr<LocalAudioSource> source(
rtc::scoped_refptr<LocalAudioSource> source(
LocalAudioSource::Create(options_, constraints));
return source;
}
talk_base::scoped_refptr<VideoSourceInterface>
rtc::scoped_refptr<VideoSourceInterface>
PeerConnectionFactory::CreateVideoSource_s(
cricket::VideoCapturer* capturer,
const MediaConstraintsInterface* constraints) {
talk_base::scoped_refptr<VideoSource> source(
rtc::scoped_refptr<VideoSource> source(
VideoSource::Create(channel_manager_.get(), capturer, constraints));
return VideoSourceProxy::Create(signaling_thread_, source);
}
bool PeerConnectionFactory::StartAecDump_s(talk_base::PlatformFile file) {
bool PeerConnectionFactory::StartAecDump_s(rtc::PlatformFile file) {
return channel_manager_->StartAecDump(file);
}
talk_base::scoped_refptr<PeerConnectionInterface>
rtc::scoped_refptr<PeerConnectionInterface>
PeerConnectionFactory::CreatePeerConnection(
const PeerConnectionInterface::RTCConfiguration& configuration,
const MediaConstraintsInterface* constraints,
@ -296,7 +296,7 @@ PeerConnectionFactory::CreatePeerConnection(
return params.peerconnection;
}
talk_base::scoped_refptr<PeerConnectionInterface>
rtc::scoped_refptr<PeerConnectionInterface>
PeerConnectionFactory::CreatePeerConnection_s(
const PeerConnectionInterface::RTCConfiguration& configuration,
const MediaConstraintsInterface* constraints,
@ -304,8 +304,8 @@ PeerConnectionFactory::CreatePeerConnection_s(
DTLSIdentityServiceInterface* dtls_identity_service,
PeerConnectionObserver* observer) {
ASSERT(allocator_factory || allocator_factory_);
talk_base::scoped_refptr<PeerConnection> pc(
new talk_base::RefCountedObject<PeerConnection>(this));
rtc::scoped_refptr<PeerConnection> pc(
new rtc::RefCountedObject<PeerConnection>(this));
if (!pc->Initialize(
configuration,
constraints,
@ -317,13 +317,13 @@ PeerConnectionFactory::CreatePeerConnection_s(
return PeerConnectionProxy::Create(signaling_thread(), pc);
}
talk_base::scoped_refptr<MediaStreamInterface>
rtc::scoped_refptr<MediaStreamInterface>
PeerConnectionFactory::CreateLocalMediaStream(const std::string& label) {
return MediaStreamProxy::Create(signaling_thread_,
MediaStream::Create(label));
}
talk_base::scoped_refptr<AudioSourceInterface>
rtc::scoped_refptr<AudioSourceInterface>
PeerConnectionFactory::CreateAudioSource(
const MediaConstraintsInterface* constraints) {
CreateAudioSourceParams params(constraints);
@ -331,7 +331,7 @@ PeerConnectionFactory::CreateAudioSource(
return params.source;
}
talk_base::scoped_refptr<VideoSourceInterface>
rtc::scoped_refptr<VideoSourceInterface>
PeerConnectionFactory::CreateVideoSource(
cricket::VideoCapturer* capturer,
const MediaConstraintsInterface* constraints) {
@ -342,24 +342,24 @@ PeerConnectionFactory::CreateVideoSource(
return params.source;
}
talk_base::scoped_refptr<VideoTrackInterface>
rtc::scoped_refptr<VideoTrackInterface>
PeerConnectionFactory::CreateVideoTrack(
const std::string& id,
VideoSourceInterface* source) {
talk_base::scoped_refptr<VideoTrackInterface> track(
rtc::scoped_refptr<VideoTrackInterface> track(
VideoTrack::Create(id, source));
return VideoTrackProxy::Create(signaling_thread_, track);
}
talk_base::scoped_refptr<AudioTrackInterface>
rtc::scoped_refptr<AudioTrackInterface>
PeerConnectionFactory::CreateAudioTrack(const std::string& id,
AudioSourceInterface* source) {
talk_base::scoped_refptr<AudioTrackInterface> track(
rtc::scoped_refptr<AudioTrackInterface> track(
AudioTrack::Create(id, source));
return AudioTrackProxy::Create(signaling_thread_, track);
}
bool PeerConnectionFactory::StartAecDump(talk_base::PlatformFile file) {
bool PeerConnectionFactory::StartAecDump(rtc::PlatformFile file) {
StartAecDumpParams params(file);
signaling_thread_->Send(this, MSG_START_AEC_DUMP, &params);
return params.result;
@ -369,11 +369,11 @@ cricket::ChannelManager* PeerConnectionFactory::channel_manager() {
return channel_manager_.get();
}
talk_base::Thread* PeerConnectionFactory::signaling_thread() {
rtc::Thread* PeerConnectionFactory::signaling_thread() {
return signaling_thread_;
}
talk_base::Thread* PeerConnectionFactory::worker_thread() {
rtc::Thread* PeerConnectionFactory::worker_thread() {
return worker_thread_;
}

View File

@ -31,20 +31,20 @@
#include "talk/app/webrtc/mediastreaminterface.h"
#include "talk/app/webrtc/peerconnectioninterface.h"
#include "talk/base/scoped_ptr.h"
#include "talk/base/thread.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread.h"
#include "talk/session/media/channelmanager.h"
namespace webrtc {
class PeerConnectionFactory : public PeerConnectionFactoryInterface,
public talk_base::MessageHandler {
public rtc::MessageHandler {
public:
virtual void SetOptions(const Options& options) {
options_ = options;
}
virtual talk_base::scoped_refptr<PeerConnectionInterface>
virtual rtc::scoped_refptr<PeerConnectionInterface>
CreatePeerConnection(
const PeerConnectionInterface::RTCConfiguration& configuration,
const MediaConstraintsInterface* constraints,
@ -54,36 +54,36 @@ class PeerConnectionFactory : public PeerConnectionFactoryInterface,
bool Initialize();
virtual talk_base::scoped_refptr<MediaStreamInterface>
virtual rtc::scoped_refptr<MediaStreamInterface>
CreateLocalMediaStream(const std::string& label);
virtual talk_base::scoped_refptr<AudioSourceInterface> CreateAudioSource(
virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource(
const MediaConstraintsInterface* constraints);
virtual talk_base::scoped_refptr<VideoSourceInterface> CreateVideoSource(
virtual rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource(
cricket::VideoCapturer* capturer,
const MediaConstraintsInterface* constraints);
virtual talk_base::scoped_refptr<VideoTrackInterface>
virtual rtc::scoped_refptr<VideoTrackInterface>
CreateVideoTrack(const std::string& id,
VideoSourceInterface* video_source);
virtual talk_base::scoped_refptr<AudioTrackInterface>
virtual rtc::scoped_refptr<AudioTrackInterface>
CreateAudioTrack(const std::string& id,
AudioSourceInterface* audio_source);
virtual bool StartAecDump(talk_base::PlatformFile file);
virtual bool StartAecDump(rtc::PlatformFile file);
virtual cricket::ChannelManager* channel_manager();
virtual talk_base::Thread* signaling_thread();
virtual talk_base::Thread* worker_thread();
virtual rtc::Thread* signaling_thread();
virtual rtc::Thread* worker_thread();
const Options& options() const { return options_; }
protected:
PeerConnectionFactory();
PeerConnectionFactory(
talk_base::Thread* worker_thread,
talk_base::Thread* signaling_thread,
rtc::Thread* worker_thread,
rtc::Thread* signaling_thread,
AudioDeviceModule* default_adm,
cricket::WebRtcVideoEncoderFactory* video_encoder_factory,
cricket::WebRtcVideoDecoderFactory* video_decoder_factory);
@ -92,39 +92,39 @@ class PeerConnectionFactory : public PeerConnectionFactoryInterface,
private:
bool Initialize_s();
void Terminate_s();
talk_base::scoped_refptr<AudioSourceInterface> CreateAudioSource_s(
rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource_s(
const MediaConstraintsInterface* constraints);
talk_base::scoped_refptr<VideoSourceInterface> CreateVideoSource_s(
rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource_s(
cricket::VideoCapturer* capturer,
const MediaConstraintsInterface* constraints);
talk_base::scoped_refptr<PeerConnectionInterface> CreatePeerConnection_s(
rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection_s(
const PeerConnectionInterface::RTCConfiguration& configuration,
const MediaConstraintsInterface* constraints,
PortAllocatorFactoryInterface* allocator_factory,
DTLSIdentityServiceInterface* dtls_identity_service,
PeerConnectionObserver* observer);
bool StartAecDump_s(talk_base::PlatformFile file);
bool StartAecDump_s(rtc::PlatformFile file);
// Implements talk_base::MessageHandler.
void OnMessage(talk_base::Message* msg);
// Implements rtc::MessageHandler.
void OnMessage(rtc::Message* msg);
bool owns_ptrs_;
talk_base::Thread* signaling_thread_;
talk_base::Thread* worker_thread_;
rtc::Thread* signaling_thread_;
rtc::Thread* worker_thread_;
Options options_;
talk_base::scoped_refptr<PortAllocatorFactoryInterface> allocator_factory_;
rtc::scoped_refptr<PortAllocatorFactoryInterface> allocator_factory_;
// External Audio device used for audio playback.
talk_base::scoped_refptr<AudioDeviceModule> default_adm_;
talk_base::scoped_ptr<cricket::ChannelManager> channel_manager_;
rtc::scoped_refptr<AudioDeviceModule> default_adm_;
rtc::scoped_ptr<cricket::ChannelManager> channel_manager_;
// External Video encoder factory. This can be NULL if the client has not
// injected any. In that case, video engine will use the internal SW encoder.
talk_base::scoped_ptr<cricket::WebRtcVideoEncoderFactory>
rtc::scoped_ptr<cricket::WebRtcVideoEncoderFactory>
video_encoder_factory_;
// External Video decoder factory. This can be NULL if the client has not
// injected any. In that case, video engine will use the internal SW decoder.
talk_base::scoped_ptr<cricket::WebRtcVideoDecoderFactory>
rtc::scoped_ptr<cricket::WebRtcVideoDecoderFactory>
video_decoder_factory_;
};

View File

@ -32,9 +32,9 @@
#include "talk/app/webrtc/peerconnectionfactory.h"
#include "talk/app/webrtc/videosourceinterface.h"
#include "talk/app/webrtc/test/fakevideotrackrenderer.h"
#include "talk/base/gunit.h"
#include "talk/base/scoped_ptr.h"
#include "talk/base/thread.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread.h"
#include "talk/media/base/fakevideocapturer.h"
#include "talk/media/webrtc/webrtccommon.h"
#include "talk/media/webrtc/webrtcvoe.h"
@ -102,8 +102,8 @@ class NullPeerConnectionObserver : public PeerConnectionObserver {
class PeerConnectionFactoryTest : public testing::Test {
void SetUp() {
factory_ = webrtc::CreatePeerConnectionFactory(talk_base::Thread::Current(),
talk_base::Thread::Current(),
factory_ = webrtc::CreatePeerConnectionFactory(rtc::Thread::Current(),
rtc::Thread::Current(),
NULL,
NULL,
NULL);
@ -141,21 +141,21 @@ class PeerConnectionFactoryTest : public testing::Test {
}
}
talk_base::scoped_refptr<PeerConnectionFactoryInterface> factory_;
rtc::scoped_refptr<PeerConnectionFactoryInterface> factory_;
NullPeerConnectionObserver observer_;
talk_base::scoped_refptr<PortAllocatorFactoryInterface> allocator_factory_;
rtc::scoped_refptr<PortAllocatorFactoryInterface> allocator_factory_;
};
// Verify creation of PeerConnection using internal ADM, video factory and
// internal libjingle threads.
TEST(PeerConnectionFactoryTestInternal, CreatePCUsingInternalModules) {
talk_base::scoped_refptr<PeerConnectionFactoryInterface> factory(
rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
webrtc::CreatePeerConnectionFactory());
NullPeerConnectionObserver observer;
webrtc::PeerConnectionInterface::IceServers servers;
talk_base::scoped_refptr<PeerConnectionInterface> pc(
rtc::scoped_refptr<PeerConnectionInterface> pc(
factory->CreatePeerConnection(servers, NULL, NULL, NULL, &observer));
EXPECT_TRUE(pc.get() != NULL);
@ -174,7 +174,7 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServers) {
ice_server.uri = kTurnIceServerWithTransport;
ice_server.password = kTurnPassword;
config.servers.push_back(ice_server);
talk_base::scoped_refptr<PeerConnectionInterface> pc(
rtc::scoped_refptr<PeerConnectionInterface> pc(
factory_->CreatePeerConnection(config, NULL,
allocator_factory_.get(),
NULL,
@ -210,7 +210,7 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersOldSignature) {
ice_server.uri = kTurnIceServerWithTransport;
ice_server.password = kTurnPassword;
ice_servers.push_back(ice_server);
talk_base::scoped_refptr<PeerConnectionInterface> pc(
rtc::scoped_refptr<PeerConnectionInterface> pc(
factory_->CreatePeerConnection(ice_servers, NULL,
allocator_factory_.get(),
NULL,
@ -240,7 +240,7 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingNoUsernameInUri) {
ice_server.username = kTurnUsername;
ice_server.password = kTurnPassword;
config.servers.push_back(ice_server);
talk_base::scoped_refptr<PeerConnectionInterface> pc(
rtc::scoped_refptr<PeerConnectionInterface> pc(
factory_->CreatePeerConnection(config, NULL,
allocator_factory_.get(),
NULL,
@ -261,7 +261,7 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingTurnUrlWithTransportParam) {
ice_server.uri = kTurnIceServerWithTransport;
ice_server.password = kTurnPassword;
config.servers.push_back(ice_server);
talk_base::scoped_refptr<PeerConnectionInterface> pc(
rtc::scoped_refptr<PeerConnectionInterface> pc(
factory_->CreatePeerConnection(config, NULL,
allocator_factory_.get(),
NULL,
@ -286,7 +286,7 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingSecureTurnUrl) {
ice_server.uri = kSecureTurnIceServerWithoutTransportAndPortParam;
ice_server.password = kTurnPassword;
config.servers.push_back(ice_server);
talk_base::scoped_refptr<PeerConnectionInterface> pc(
rtc::scoped_refptr<PeerConnectionInterface> pc(
factory_->CreatePeerConnection(config, NULL,
allocator_factory_.get(),
NULL,
@ -323,7 +323,7 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIPLiteralAddress) {
ice_server.uri = kTurnIceServerWithIPv6Address;
ice_server.password = kTurnPassword;
config.servers.push_back(ice_server);
talk_base::scoped_refptr<PeerConnectionInterface> pc(
rtc::scoped_refptr<PeerConnectionInterface> pc(
factory_->CreatePeerConnection(config, NULL,
allocator_factory_.get(),
NULL,
@ -356,10 +356,10 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIPLiteralAddress) {
TEST_F(PeerConnectionFactoryTest, LocalRendering) {
cricket::FakeVideoCapturer* capturer = new cricket::FakeVideoCapturer();
// The source take ownership of |capturer|.
talk_base::scoped_refptr<VideoSourceInterface> source(
rtc::scoped_refptr<VideoSourceInterface> source(
factory_->CreateVideoSource(capturer, NULL));
ASSERT_TRUE(source.get() != NULL);
talk_base::scoped_refptr<VideoTrackInterface> track(
rtc::scoped_refptr<VideoTrackInterface> track(
factory_->CreateVideoTrack("testlabel", source));
ASSERT_TRUE(track.get() != NULL);
FakeVideoTrackRenderer local_renderer(track);

View File

@ -77,10 +77,10 @@
#include "talk/app/webrtc/mediastreaminterface.h"
#include "talk/app/webrtc/statstypes.h"
#include "talk/app/webrtc/umametrics.h"
#include "talk/base/fileutils.h"
#include "talk/base/socketaddress.h"
#include "webrtc/base/fileutils.h"
#include "webrtc/base/socketaddress.h"
namespace talk_base {
namespace rtc {
class Thread;
}
@ -95,7 +95,7 @@ class AudioDeviceModule;
class MediaConstraintsInterface;
// MediaStream container interface.
class StreamCollectionInterface : public talk_base::RefCountInterface {
class StreamCollectionInterface : public rtc::RefCountInterface {
public:
// TODO(ronghuawu): Update the function names to c++ style, e.g. find -> Find.
virtual size_t count() = 0;
@ -111,7 +111,7 @@ class StreamCollectionInterface : public talk_base::RefCountInterface {
~StreamCollectionInterface() {}
};
class StatsObserver : public talk_base::RefCountInterface {
class StatsObserver : public rtc::RefCountInterface {
public:
virtual void OnComplete(const std::vector<StatsReport>& reports) = 0;
@ -119,7 +119,7 @@ class StatsObserver : public talk_base::RefCountInterface {
virtual ~StatsObserver() {}
};
class UMAObserver : public talk_base::RefCountInterface {
class UMAObserver : public rtc::RefCountInterface {
public:
virtual void IncrementCounter(PeerConnectionUMAMetricsCounter type) = 0;
virtual void AddHistogramSample(PeerConnectionUMAMetricsName type,
@ -129,7 +129,7 @@ class UMAObserver : public talk_base::RefCountInterface {
virtual ~UMAObserver() {}
};
class PeerConnectionInterface : public talk_base::RefCountInterface {
class PeerConnectionInterface : public rtc::RefCountInterface {
public:
// See http://dev.w3.org/2011/webrtc/editor/webrtc.html#state-definitions .
enum SignalingState {
@ -202,11 +202,11 @@ class PeerConnectionInterface : public talk_base::RefCountInterface {
};
// Accessor methods to active local streams.
virtual talk_base::scoped_refptr<StreamCollectionInterface>
virtual rtc::scoped_refptr<StreamCollectionInterface>
local_streams() = 0;
// Accessor methods to remote streams.
virtual talk_base::scoped_refptr<StreamCollectionInterface>
virtual rtc::scoped_refptr<StreamCollectionInterface>
remote_streams() = 0;
// Add a new MediaStream to be sent on this PeerConnection.
@ -222,14 +222,14 @@ class PeerConnectionInterface : public talk_base::RefCountInterface {
// Returns pointer to the created DtmfSender on success.
// Otherwise returns NULL.
virtual talk_base::scoped_refptr<DtmfSenderInterface> CreateDtmfSender(
virtual rtc::scoped_refptr<DtmfSenderInterface> CreateDtmfSender(
AudioTrackInterface* track) = 0;
virtual bool GetStats(StatsObserver* observer,
MediaStreamTrackInterface* track,
StatsOutputLevel level) = 0;
virtual talk_base::scoped_refptr<DataChannelInterface> CreateDataChannel(
virtual rtc::scoped_refptr<DataChannelInterface> CreateDataChannel(
const std::string& label,
const DataChannelInit* config) = 0;
@ -340,13 +340,13 @@ class PeerConnectionObserver {
// Factory class used for creating cricket::PortAllocator that is used
// for ICE negotiation.
class PortAllocatorFactoryInterface : public talk_base::RefCountInterface {
class PortAllocatorFactoryInterface : public rtc::RefCountInterface {
public:
struct StunConfiguration {
StunConfiguration(const std::string& address, int port)
: server(address, port) {}
// STUN server address and port.
talk_base::SocketAddress server;
rtc::SocketAddress server;
};
struct TurnConfiguration {
@ -361,7 +361,7 @@ class PortAllocatorFactoryInterface : public talk_base::RefCountInterface {
password(password),
transport_type(transport_type),
secure(secure) {}
talk_base::SocketAddress server;
rtc::SocketAddress server;
std::string username;
std::string password;
std::string transport_type;
@ -378,7 +378,7 @@ class PortAllocatorFactoryInterface : public talk_base::RefCountInterface {
};
// Used to receive callbacks of DTLS identity requests.
class DTLSIdentityRequestObserver : public talk_base::RefCountInterface {
class DTLSIdentityRequestObserver : public rtc::RefCountInterface {
public:
virtual void OnFailure(int error) = 0;
virtual void OnSuccess(const std::string& der_cert,
@ -427,7 +427,7 @@ class DTLSIdentityServiceInterface {
// CreatePeerConnectionFactory method which accepts threads as input and use the
// CreatePeerConnection version that takes a PortAllocatorFactoryInterface as
// argument.
class PeerConnectionFactoryInterface : public talk_base::RefCountInterface {
class PeerConnectionFactoryInterface : public rtc::RefCountInterface {
public:
class Options {
public:
@ -441,7 +441,7 @@ class PeerConnectionFactoryInterface : public talk_base::RefCountInterface {
virtual void SetOptions(const Options& options) = 0;
virtual talk_base::scoped_refptr<PeerConnectionInterface>
virtual rtc::scoped_refptr<PeerConnectionInterface>
CreatePeerConnection(
const PeerConnectionInterface::RTCConfiguration& configuration,
const MediaConstraintsInterface* constraints,
@ -455,7 +455,7 @@ class PeerConnectionFactoryInterface : public talk_base::RefCountInterface {
// and not IceServers. RTCConfiguration is made up of ice servers and
// ice transport type.
// http://dev.w3.org/2011/webrtc/editor/webrtc.html
inline talk_base::scoped_refptr<PeerConnectionInterface>
inline rtc::scoped_refptr<PeerConnectionInterface>
CreatePeerConnection(
const PeerConnectionInterface::IceServers& configuration,
const MediaConstraintsInterface* constraints,
@ -468,29 +468,29 @@ class PeerConnectionFactoryInterface : public talk_base::RefCountInterface {
dtls_identity_service, observer);
}
virtual talk_base::scoped_refptr<MediaStreamInterface>
virtual rtc::scoped_refptr<MediaStreamInterface>
CreateLocalMediaStream(const std::string& label) = 0;
// Creates a AudioSourceInterface.
// |constraints| decides audio processing settings but can be NULL.
virtual talk_base::scoped_refptr<AudioSourceInterface> CreateAudioSource(
virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource(
const MediaConstraintsInterface* constraints) = 0;
// Creates a VideoSourceInterface. The new source take ownership of
// |capturer|. |constraints| decides video resolution and frame rate but can
// be NULL.
virtual talk_base::scoped_refptr<VideoSourceInterface> CreateVideoSource(
virtual rtc::scoped_refptr<VideoSourceInterface> CreateVideoSource(
cricket::VideoCapturer* capturer,
const MediaConstraintsInterface* constraints) = 0;
// Creates a new local VideoTrack. The same |source| can be used in several
// tracks.
virtual talk_base::scoped_refptr<VideoTrackInterface>
virtual rtc::scoped_refptr<VideoTrackInterface>
CreateVideoTrack(const std::string& label,
VideoSourceInterface* source) = 0;
// Creates an new AudioTrack. At the moment |source| can be NULL.
virtual talk_base::scoped_refptr<AudioTrackInterface>
virtual rtc::scoped_refptr<AudioTrackInterface>
CreateAudioTrack(const std::string& label,
AudioSourceInterface* source) = 0;
@ -499,7 +499,7 @@ class PeerConnectionFactoryInterface : public talk_base::RefCountInterface {
// the ownerhip. If the operation fails, the file will be closed.
// TODO(grunell): Remove when Chromium has started to use AEC in each source.
// http://crbug.com/264611.
virtual bool StartAecDump(talk_base::PlatformFile file) = 0;
virtual bool StartAecDump(rtc::PlatformFile file) = 0;
protected:
// Dtor and ctor protected as objects shouldn't be created or deleted via
@ -509,16 +509,16 @@ class PeerConnectionFactoryInterface : public talk_base::RefCountInterface {
};
// Create a new instance of PeerConnectionFactoryInterface.
talk_base::scoped_refptr<PeerConnectionFactoryInterface>
rtc::scoped_refptr<PeerConnectionFactoryInterface>
CreatePeerConnectionFactory();
// Create a new instance of PeerConnectionFactoryInterface.
// Ownership of |factory|, |default_adm|, and optionally |encoder_factory| and
// |decoder_factory| transferred to the returned factory.
talk_base::scoped_refptr<PeerConnectionFactoryInterface>
rtc::scoped_refptr<PeerConnectionFactoryInterface>
CreatePeerConnectionFactory(
talk_base::Thread* worker_thread,
talk_base::Thread* signaling_thread,
rtc::Thread* worker_thread,
rtc::Thread* signaling_thread,
AudioDeviceModule* default_adm,
cricket::WebRtcVideoEncoderFactory* encoder_factory,
cricket::WebRtcVideoDecoderFactory* decoder_factory);

View File

@ -36,12 +36,12 @@
#include "talk/app/webrtc/test/mockpeerconnectionobservers.h"
#include "talk/app/webrtc/test/testsdpstrings.h"
#include "talk/app/webrtc/videosource.h"
#include "talk/base/gunit.h"
#include "talk/base/scoped_ptr.h"
#include "talk/base/ssladapter.h"
#include "talk/base/sslstreamadapter.h"
#include "talk/base/stringutils.h"
#include "talk/base/thread.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/ssladapter.h"
#include "webrtc/base/sslstreamadapter.h"
#include "webrtc/base/stringutils.h"
#include "webrtc/base/thread.h"
#include "talk/media/base/fakevideocapturer.h"
#include "talk/media/sctp/sctpdataengine.h"
#include "talk/session/media/mediasession.h"
@ -66,8 +66,8 @@ static const uint32 kTimeout = 5000U;
return; \
}
using talk_base::scoped_ptr;
using talk_base::scoped_refptr;
using rtc::scoped_ptr;
using rtc::scoped_refptr;
using webrtc::AudioSourceInterface;
using webrtc::AudioTrackInterface;
using webrtc::DataBuffer;
@ -229,15 +229,15 @@ class MockPeerConnectionObserver : public PeerConnectionObserver {
class PeerConnectionInterfaceTest : public testing::Test {
protected:
virtual void SetUp() {
talk_base::InitializeSSL(NULL);
rtc::InitializeSSL(NULL);
pc_factory_ = webrtc::CreatePeerConnectionFactory(
talk_base::Thread::Current(), talk_base::Thread::Current(), NULL, NULL,
rtc::Thread::Current(), rtc::Thread::Current(), NULL, NULL,
NULL);
ASSERT_TRUE(pc_factory_.get() != NULL);
}
virtual void TearDown() {
talk_base::CleanupSSL();
rtc::CleanupSSL();
}
void CreatePeerConnection() {
@ -361,8 +361,8 @@ class PeerConnectionInterfaceTest : public testing::Test {
}
bool DoCreateOfferAnswer(SessionDescriptionInterface** desc, bool offer) {
talk_base::scoped_refptr<MockCreateSessionDescriptionObserver>
observer(new talk_base::RefCountedObject<
rtc::scoped_refptr<MockCreateSessionDescriptionObserver>
observer(new rtc::RefCountedObject<
MockCreateSessionDescriptionObserver>());
if (offer) {
pc_->CreateOffer(observer, NULL);
@ -383,8 +383,8 @@ class PeerConnectionInterfaceTest : public testing::Test {
}
bool DoSetSessionDescription(SessionDescriptionInterface* desc, bool local) {
talk_base::scoped_refptr<MockSetSessionDescriptionObserver>
observer(new talk_base::RefCountedObject<
rtc::scoped_refptr<MockSetSessionDescriptionObserver>
observer(new rtc::RefCountedObject<
MockSetSessionDescriptionObserver>());
if (local) {
pc_->SetLocalDescription(observer, desc);
@ -407,8 +407,8 @@ class PeerConnectionInterfaceTest : public testing::Test {
// It does not verify the values in the StatReports since a RTCP packet might
// be required.
bool DoGetStats(MediaStreamTrackInterface* track) {
talk_base::scoped_refptr<MockStatsObserver> observer(
new talk_base::RefCountedObject<MockStatsObserver>());
rtc::scoped_refptr<MockStatsObserver> observer(
new rtc::RefCountedObject<MockStatsObserver>());
if (!pc_->GetStats(
observer, track, PeerConnectionInterface::kStatsOutputLevelStandard))
return false;
@ -438,7 +438,7 @@ class PeerConnectionInterfaceTest : public testing::Test {
}
void CreateOfferAsRemoteDescription() {
talk_base::scoped_ptr<SessionDescriptionInterface> offer;
rtc::scoped_ptr<SessionDescriptionInterface> offer;
EXPECT_TRUE(DoCreateOffer(offer.use()));
std::string sdp;
EXPECT_TRUE(offer->ToString(&sdp));
@ -490,7 +490,7 @@ class PeerConnectionInterfaceTest : public testing::Test {
}
void CreateOfferAsLocalDescription() {
talk_base::scoped_ptr<SessionDescriptionInterface> offer;
rtc::scoped_ptr<SessionDescriptionInterface> offer;
ASSERT_TRUE(DoCreateOffer(offer.use()));
// TODO(perkj): Currently SetLocalDescription fails if any parameters in an
// audio codec change, even if the parameter has nothing to do with
@ -792,9 +792,9 @@ TEST_F(PeerConnectionInterfaceTest, TestDataChannel) {
scoped_refptr<DataChannelInterface> data2 =
pc_->CreateDataChannel("test2", NULL);
ASSERT_TRUE(data1 != NULL);
talk_base::scoped_ptr<MockDataChannelObserver> observer1(
rtc::scoped_ptr<MockDataChannelObserver> observer1(
new MockDataChannelObserver(data1));
talk_base::scoped_ptr<MockDataChannelObserver> observer2(
rtc::scoped_ptr<MockDataChannelObserver> observer2(
new MockDataChannelObserver(data2));
EXPECT_EQ(DataChannelInterface::kConnecting, data1->state());
@ -839,9 +839,9 @@ TEST_F(PeerConnectionInterfaceTest, TestSendBinaryOnRtpDataChannel) {
scoped_refptr<DataChannelInterface> data2 =
pc_->CreateDataChannel("test2", NULL);
ASSERT_TRUE(data1 != NULL);
talk_base::scoped_ptr<MockDataChannelObserver> observer1(
rtc::scoped_ptr<MockDataChannelObserver> observer1(
new MockDataChannelObserver(data1));
talk_base::scoped_ptr<MockDataChannelObserver> observer2(
rtc::scoped_ptr<MockDataChannelObserver> observer2(
new MockDataChannelObserver(data2));
EXPECT_EQ(DataChannelInterface::kConnecting, data1->state());
@ -854,7 +854,7 @@ TEST_F(PeerConnectionInterfaceTest, TestSendBinaryOnRtpDataChannel) {
EXPECT_EQ(DataChannelInterface::kOpen, data1->state());
EXPECT_EQ(DataChannelInterface::kOpen, data2->state());
talk_base::Buffer buffer("test", 4);
rtc::Buffer buffer("test", 4);
EXPECT_FALSE(data1->Send(DataBuffer(buffer, true)));
}
@ -866,7 +866,7 @@ TEST_F(PeerConnectionInterfaceTest, TestSendOnlyDataChannel) {
CreatePeerConnection(&constraints);
scoped_refptr<DataChannelInterface> data1 =
pc_->CreateDataChannel("test1", NULL);
talk_base::scoped_ptr<MockDataChannelObserver> observer1(
rtc::scoped_ptr<MockDataChannelObserver> observer1(
new MockDataChannelObserver(data1));
CreateOfferReceiveAnswerWithoutSsrc();
@ -897,7 +897,7 @@ TEST_F(PeerConnectionInterfaceTest, TestReceiveOnlyDataChannel) {
std::string receive_label = "answer_channel";
std::string sdp;
EXPECT_TRUE(pc_->local_description()->ToString(&sdp));
talk_base::replace_substrs(offer_label.c_str(), offer_label.length(),
rtc::replace_substrs(offer_label.c_str(), offer_label.length(),
receive_label.c_str(), receive_label.length(),
&sdp);
CreateAnswerAsRemoteDescription(sdp);
@ -1048,9 +1048,9 @@ TEST_F(PeerConnectionInterfaceTest, DataChannelCloseWhenPeerConnectionClose) {
scoped_refptr<DataChannelInterface> data2 =
pc_->CreateDataChannel("test2", NULL);
ASSERT_TRUE(data1 != NULL);
talk_base::scoped_ptr<MockDataChannelObserver> observer1(
rtc::scoped_ptr<MockDataChannelObserver> observer1(
new MockDataChannelObserver(data1));
talk_base::scoped_ptr<MockDataChannelObserver> observer2(
rtc::scoped_ptr<MockDataChannelObserver> observer2(
new MockDataChannelObserver(data2));
CreateOfferReceiveAnswer();
@ -1091,7 +1091,7 @@ TEST_F(PeerConnectionInterfaceTest, TestRejectDataChannelInAnswer) {
// FireFox, use it as a remote session description, generate an answer and use
// the answer as a local description.
TEST_F(PeerConnectionInterfaceTest, ReceiveFireFoxOffer) {
MAYBE_SKIP_TEST(talk_base::SSLStreamAdapter::HaveDtlsSrtp);
MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp);
FakeConstraints constraints;
constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp,
true);
@ -1188,7 +1188,7 @@ TEST_F(PeerConnectionInterfaceTest, CloseAndTestMethods) {
EXPECT_FALSE(pc_->AddStream(local_stream, NULL));
ASSERT_FALSE(local_stream->GetAudioTracks().empty());
talk_base::scoped_refptr<webrtc::DtmfSenderInterface> dtmf_sender(
rtc::scoped_refptr<webrtc::DtmfSenderInterface> dtmf_sender(
pc_->CreateDtmfSender(local_stream->GetAudioTracks()[0]));
EXPECT_TRUE(NULL == dtmf_sender); // local stream has been removed.
@ -1197,9 +1197,9 @@ TEST_F(PeerConnectionInterfaceTest, CloseAndTestMethods) {
EXPECT_TRUE(pc_->local_description() != NULL);
EXPECT_TRUE(pc_->remote_description() != NULL);
talk_base::scoped_ptr<SessionDescriptionInterface> offer;
rtc::scoped_ptr<SessionDescriptionInterface> offer;
EXPECT_TRUE(DoCreateOffer(offer.use()));
talk_base::scoped_ptr<SessionDescriptionInterface> answer;
rtc::scoped_ptr<SessionDescriptionInterface> answer;
EXPECT_TRUE(DoCreateAnswer(answer.use()));
std::string sdp;

View File

@ -35,19 +35,19 @@ namespace webrtc {
// Define proxy for PeerConnectionInterface.
BEGIN_PROXY_MAP(PeerConnection)
PROXY_METHOD0(talk_base::scoped_refptr<StreamCollectionInterface>,
PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>,
local_streams)
PROXY_METHOD0(talk_base::scoped_refptr<StreamCollectionInterface>,
PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>,
remote_streams)
PROXY_METHOD2(bool, AddStream, MediaStreamInterface*,
const MediaConstraintsInterface*)
PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*)
PROXY_METHOD1(talk_base::scoped_refptr<DtmfSenderInterface>,
PROXY_METHOD1(rtc::scoped_refptr<DtmfSenderInterface>,
CreateDtmfSender, AudioTrackInterface*)
PROXY_METHOD3(bool, GetStats, StatsObserver*,
MediaStreamTrackInterface*,
StatsOutputLevel)
PROXY_METHOD2(talk_base::scoped_refptr<DataChannelInterface>,
PROXY_METHOD2(rtc::scoped_refptr<DataChannelInterface>,
CreateDataChannel, const std::string&, const DataChannelInit*)
PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, local_description)
PROXY_CONSTMETHOD0(const SessionDescriptionInterface*, remote_description)

View File

@ -27,27 +27,27 @@
#include "talk/app/webrtc/portallocatorfactory.h"
#include "talk/base/logging.h"
#include "talk/base/network.h"
#include "talk/base/thread.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/network.h"
#include "webrtc/base/thread.h"
#include "talk/p2p/base/basicpacketsocketfactory.h"
#include "talk/p2p/client/basicportallocator.h"
namespace webrtc {
using talk_base::scoped_ptr;
using rtc::scoped_ptr;
talk_base::scoped_refptr<PortAllocatorFactoryInterface>
rtc::scoped_refptr<PortAllocatorFactoryInterface>
PortAllocatorFactory::Create(
talk_base::Thread* worker_thread) {
talk_base::RefCountedObject<PortAllocatorFactory>* allocator =
new talk_base::RefCountedObject<PortAllocatorFactory>(worker_thread);
rtc::Thread* worker_thread) {
rtc::RefCountedObject<PortAllocatorFactory>* allocator =
new rtc::RefCountedObject<PortAllocatorFactory>(worker_thread);
return allocator;
}
PortAllocatorFactory::PortAllocatorFactory(talk_base::Thread* worker_thread)
: network_manager_(new talk_base::BasicNetworkManager()),
socket_factory_(new talk_base::BasicPacketSocketFactory(worker_thread)) {
PortAllocatorFactory::PortAllocatorFactory(rtc::Thread* worker_thread)
: network_manager_(new rtc::BasicNetworkManager()),
socket_factory_(new rtc::BasicPacketSocketFactory(worker_thread)) {
}
PortAllocatorFactory::~PortAllocatorFactory() {}

View File

@ -34,13 +34,13 @@
#define TALK_APP_WEBRTC_PORTALLOCATORFACTORY_H_
#include "talk/app/webrtc/peerconnectioninterface.h"
#include "talk/base/scoped_ptr.h"
#include "webrtc/base/scoped_ptr.h"
namespace cricket {
class PortAllocator;
}
namespace talk_base {
namespace rtc {
class BasicNetworkManager;
class BasicPacketSocketFactory;
}
@ -49,20 +49,20 @@ namespace webrtc {
class PortAllocatorFactory : public PortAllocatorFactoryInterface {
public:
static talk_base::scoped_refptr<PortAllocatorFactoryInterface> Create(
talk_base::Thread* worker_thread);
static rtc::scoped_refptr<PortAllocatorFactoryInterface> Create(
rtc::Thread* worker_thread);
virtual cricket::PortAllocator* CreatePortAllocator(
const std::vector<StunConfiguration>& stun,
const std::vector<TurnConfiguration>& turn);
protected:
explicit PortAllocatorFactory(talk_base::Thread* worker_thread);
explicit PortAllocatorFactory(rtc::Thread* worker_thread);
~PortAllocatorFactory();
private:
talk_base::scoped_ptr<talk_base::BasicNetworkManager> network_manager_;
talk_base::scoped_ptr<talk_base::BasicPacketSocketFactory> socket_factory_;
rtc::scoped_ptr<rtc::BasicNetworkManager> network_manager_;
rtc::scoped_ptr<rtc::BasicPacketSocketFactory> socket_factory_;
};
} // namespace webrtc

View File

@ -31,7 +31,7 @@
//
// Example usage:
//
// class TestInterface : public talk_base::RefCountInterface {
// class TestInterface : public rtc::RefCountInterface {
// public:
// std::string FooA() = 0;
// std::string FooB(bool arg1) const = 0;
@ -55,7 +55,7 @@
#ifndef TALK_APP_WEBRTC_PROXY_H_
#define TALK_APP_WEBRTC_PROXY_H_
#include "talk/base/thread.h"
#include "webrtc/base/thread.h"
namespace webrtc {
@ -93,19 +93,19 @@ class ReturnType<void> {
};
template <typename C, typename R>
class MethodCall0 : public talk_base::Message,
public talk_base::MessageHandler {
class MethodCall0 : public rtc::Message,
public rtc::MessageHandler {
public:
typedef R (C::*Method)();
MethodCall0(C* c, Method m) : c_(c), m_(m) {}
R Marshal(talk_base::Thread* t) {
R Marshal(rtc::Thread* t) {
t->Send(this, 0);
return r_.value();
}
private:
void OnMessage(talk_base::Message*) { r_.Invoke(c_, m_);}
void OnMessage(rtc::Message*) { r_.Invoke(c_, m_);}
C* c_;
Method m_;
@ -113,19 +113,19 @@ class MethodCall0 : public talk_base::Message,
};
template <typename C, typename R>
class ConstMethodCall0 : public talk_base::Message,
public talk_base::MessageHandler {
class ConstMethodCall0 : public rtc::Message,
public rtc::MessageHandler {
public:
typedef R (C::*Method)() const;
ConstMethodCall0(C* c, Method m) : c_(c), m_(m) {}
R Marshal(talk_base::Thread* t) {
R Marshal(rtc::Thread* t) {
t->Send(this, 0);
return r_.value();
}
private:
void OnMessage(talk_base::Message*) { r_.Invoke(c_, m_); }
void OnMessage(rtc::Message*) { r_.Invoke(c_, m_); }
C* c_;
Method m_;
@ -133,19 +133,19 @@ class ConstMethodCall0 : public talk_base::Message,
};
template <typename C, typename R, typename T1>
class MethodCall1 : public talk_base::Message,
public talk_base::MessageHandler {
class MethodCall1 : public rtc::Message,
public rtc::MessageHandler {
public:
typedef R (C::*Method)(T1 a1);
MethodCall1(C* c, Method m, T1 a1) : c_(c), m_(m), a1_(a1) {}
R Marshal(talk_base::Thread* t) {
R Marshal(rtc::Thread* t) {
t->Send(this, 0);
return r_.value();
}
private:
void OnMessage(talk_base::Message*) { r_.Invoke(c_, m_, a1_); }
void OnMessage(rtc::Message*) { r_.Invoke(c_, m_, a1_); }
C* c_;
Method m_;
@ -154,19 +154,19 @@ class MethodCall1 : public talk_base::Message,
};
template <typename C, typename R, typename T1>
class ConstMethodCall1 : public talk_base::Message,
public talk_base::MessageHandler {
class ConstMethodCall1 : public rtc::Message,
public rtc::MessageHandler {
public:
typedef R (C::*Method)(T1 a1) const;
ConstMethodCall1(C* c, Method m, T1 a1) : c_(c), m_(m), a1_(a1) {}
R Marshal(talk_base::Thread* t) {
R Marshal(rtc::Thread* t) {
t->Send(this, 0);
return r_.value();
}
private:
void OnMessage(talk_base::Message*) { r_.Invoke(c_, m_, a1_); }
void OnMessage(rtc::Message*) { r_.Invoke(c_, m_, a1_); }
C* c_;
Method m_;
@ -175,19 +175,19 @@ class ConstMethodCall1 : public talk_base::Message,
};
template <typename C, typename R, typename T1, typename T2>
class MethodCall2 : public talk_base::Message,
public talk_base::MessageHandler {
class MethodCall2 : public rtc::Message,
public rtc::MessageHandler {
public:
typedef R (C::*Method)(T1 a1, T2 a2);
MethodCall2(C* c, Method m, T1 a1, T2 a2) : c_(c), m_(m), a1_(a1), a2_(a2) {}
R Marshal(talk_base::Thread* t) {
R Marshal(rtc::Thread* t) {
t->Send(this, 0);
return r_.value();
}
private:
void OnMessage(talk_base::Message*) { r_.Invoke(c_, m_, a1_, a2_); }
void OnMessage(rtc::Message*) { r_.Invoke(c_, m_, a1_, a2_); }
C* c_;
Method m_;
@ -197,20 +197,20 @@ class MethodCall2 : public talk_base::Message,
};
template <typename C, typename R, typename T1, typename T2, typename T3>
class MethodCall3 : public talk_base::Message,
public talk_base::MessageHandler {
class MethodCall3 : public rtc::Message,
public rtc::MessageHandler {
public:
typedef R (C::*Method)(T1 a1, T2 a2, T3 a3);
MethodCall3(C* c, Method m, T1 a1, T2 a2, T3 a3)
: c_(c), m_(m), a1_(a1), a2_(a2), a3_(a3) {}
R Marshal(talk_base::Thread* t) {
R Marshal(rtc::Thread* t) {
t->Send(this, 0);
return r_.value();
}
private:
void OnMessage(talk_base::Message*) { r_.Invoke(c_, m_, a1_, a2_, a3_); }
void OnMessage(rtc::Message*) { r_.Invoke(c_, m_, a1_, a2_, a3_); }
C* c_;
Method m_;
@ -224,7 +224,7 @@ class MethodCall3 : public talk_base::Message,
class c##Proxy : public c##Interface {\
protected:\
typedef c##Interface C;\
c##Proxy(talk_base::Thread* thread, C* c)\
c##Proxy(rtc::Thread* thread, C* c)\
: owner_thread_(thread), \
c_(c) {}\
~c##Proxy() {\
@ -232,9 +232,9 @@ class MethodCall3 : public talk_base::Message,
call.Marshal(owner_thread_);\
}\
public:\
static talk_base::scoped_refptr<C> Create(talk_base::Thread* thread, \
static rtc::scoped_refptr<C> Create(rtc::Thread* thread, \
C* c) {\
return new talk_base::RefCountedObject<c##Proxy>(thread, c);\
return new rtc::RefCountedObject<c##Proxy>(thread, c);\
}\
#define PROXY_METHOD0(r, method)\
@ -278,8 +278,8 @@ class MethodCall3 : public talk_base::Message,
void Release_s() {\
c_ = NULL;\
}\
mutable talk_base::Thread* owner_thread_;\
talk_base::scoped_refptr<C> c_;\
mutable rtc::Thread* owner_thread_;\
rtc::scoped_refptr<C> c_;\
};\
} // namespace webrtc

View File

@ -29,10 +29,10 @@
#include <string>
#include "talk/base/refcount.h"
#include "talk/base/scoped_ptr.h"
#include "talk/base/thread.h"
#include "talk/base/gunit.h"
#include "webrtc/base/refcount.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread.h"
#include "webrtc/base/gunit.h"
#include "testing/base/public/gmock.h"
using ::testing::_;
@ -44,7 +44,7 @@ using ::testing::Return;
namespace webrtc {
// Interface used for testing here.
class FakeInterface : public talk_base::RefCountInterface {
class FakeInterface : public rtc::RefCountInterface {
public:
virtual void VoidMethod0() = 0;
virtual std::string Method0() = 0;
@ -70,8 +70,8 @@ END_PROXY()
// Implementation of the test interface.
class Fake : public FakeInterface {
public:
static talk_base::scoped_refptr<Fake> Create() {
return new talk_base::RefCountedObject<Fake>();
static rtc::scoped_refptr<Fake> Create() {
return new rtc::RefCountedObject<Fake>();
}
MOCK_METHOD0(VoidMethod0, void());
@ -92,21 +92,21 @@ class ProxyTest: public testing::Test {
public:
// Checks that the functions is called on the |signaling_thread_|.
void CheckThread() {
EXPECT_EQ(talk_base::Thread::Current(), signaling_thread_.get());
EXPECT_EQ(rtc::Thread::Current(), signaling_thread_.get());
}
protected:
virtual void SetUp() {
signaling_thread_.reset(new talk_base::Thread());
signaling_thread_.reset(new rtc::Thread());
ASSERT_TRUE(signaling_thread_->Start());
fake_ = Fake::Create();
fake_proxy_ = FakeProxy::Create(signaling_thread_.get(), fake_.get());
}
protected:
talk_base::scoped_ptr<talk_base::Thread> signaling_thread_;
talk_base::scoped_refptr<FakeInterface> fake_proxy_;
talk_base::scoped_refptr<Fake> fake_;
rtc::scoped_ptr<rtc::Thread> signaling_thread_;
rtc::scoped_refptr<FakeInterface> fake_proxy_;
rtc::scoped_refptr<Fake> fake_;
};
TEST_F(ProxyTest, VoidMethod0) {

View File

@ -30,12 +30,12 @@
#include <algorithm>
#include <functional>
#include "talk/base/logging.h"
#include "webrtc/base/logging.h"
namespace webrtc {
talk_base::scoped_refptr<RemoteAudioSource> RemoteAudioSource::Create() {
return new talk_base::RefCountedObject<RemoteAudioSource>();
rtc::scoped_refptr<RemoteAudioSource> RemoteAudioSource::Create() {
return new rtc::RefCountedObject<RemoteAudioSource>();
}
RemoteAudioSource::RemoteAudioSource() {

View File

@ -41,7 +41,7 @@ using webrtc::AudioSourceInterface;
class RemoteAudioSource : public Notifier<AudioSourceInterface> {
public:
// Creates an instance of RemoteAudioSource.
static talk_base::scoped_refptr<RemoteAudioSource> Create();
static rtc::scoped_refptr<RemoteAudioSource> Create();
protected:
RemoteAudioSource();

View File

@ -27,7 +27,7 @@
#include "talk/app/webrtc/remotevideocapturer.h"
#include "talk/base/logging.h"
#include "webrtc/base/logging.h"
#include "talk/media/base/videoframe.h"
namespace webrtc {

View File

@ -28,7 +28,7 @@
#include <string>
#include "talk/app/webrtc/remotevideocapturer.h"
#include "talk/base/gunit.h"
#include "webrtc/base/gunit.h"
#include "talk/media/webrtc/webrtcvideoframe.h"
using cricket::CaptureState;

View File

@ -27,9 +27,9 @@
#include "talk/app/webrtc/sctputils.h"
#include "talk/base/buffer.h"
#include "talk/base/bytebuffer.h"
#include "talk/base/logging.h"
#include "webrtc/base/buffer.h"
#include "webrtc/base/bytebuffer.h"
#include "webrtc/base/logging.h"
namespace webrtc {
@ -48,13 +48,13 @@ enum DataChannelOpenMessageChannelType {
DCOMCT_UNORDERED_PARTIAL_TIME = 0x82,
};
bool ParseDataChannelOpenMessage(const talk_base::Buffer& payload,
bool ParseDataChannelOpenMessage(const rtc::Buffer& payload,
std::string* label,
DataChannelInit* config) {
// Format defined at
// http://tools.ietf.org/html/draft-jesup-rtcweb-data-protocol-04
talk_base::ByteBuffer buffer(payload.data(), payload.length());
rtc::ByteBuffer buffer(payload.data(), payload.length());
uint8 message_type;
if (!buffer.ReadUInt8(&message_type)) {
@ -125,8 +125,8 @@ bool ParseDataChannelOpenMessage(const talk_base::Buffer& payload,
return true;
}
bool ParseDataChannelOpenAckMessage(const talk_base::Buffer& payload) {
talk_base::ByteBuffer buffer(payload.data(), payload.length());
bool ParseDataChannelOpenAckMessage(const rtc::Buffer& payload) {
rtc::ByteBuffer buffer(payload.data(), payload.length());
uint8 message_type;
if (!buffer.ReadUInt8(&message_type)) {
@ -143,7 +143,7 @@ bool ParseDataChannelOpenAckMessage(const talk_base::Buffer& payload) {
bool WriteDataChannelOpenMessage(const std::string& label,
const DataChannelInit& config,
talk_base::Buffer* payload) {
rtc::Buffer* payload) {
// Format defined at
// http://tools.ietf.org/html/draft-ietf-rtcweb-data-protocol-00#section-6.1
uint8 channel_type = 0;
@ -171,9 +171,9 @@ bool WriteDataChannelOpenMessage(const std::string& label,
}
}
talk_base::ByteBuffer buffer(
rtc::ByteBuffer buffer(
NULL, 20 + label.length() + config.protocol.length(),
talk_base::ByteBuffer::ORDER_NETWORK);
rtc::ByteBuffer::ORDER_NETWORK);
buffer.WriteUInt8(DATA_CHANNEL_OPEN_MESSAGE_TYPE);
buffer.WriteUInt8(channel_type);
buffer.WriteUInt16(priority);
@ -186,8 +186,8 @@ bool WriteDataChannelOpenMessage(const std::string& label,
return true;
}
void WriteDataChannelOpenAckMessage(talk_base::Buffer* payload) {
talk_base::ByteBuffer buffer(talk_base::ByteBuffer::ORDER_NETWORK);
void WriteDataChannelOpenAckMessage(rtc::Buffer* payload) {
rtc::ByteBuffer buffer(rtc::ByteBuffer::ORDER_NETWORK);
buffer.WriteUInt8(DATA_CHANNEL_OPEN_ACK_MESSAGE_TYPE);
payload->SetData(buffer.Data(), buffer.Length());
}

View File

@ -32,24 +32,24 @@
#include "talk/app/webrtc/datachannelinterface.h"
namespace talk_base {
namespace rtc {
class Buffer;
} // namespace talk_base
} // namespace rtc
namespace webrtc {
struct DataChannelInit;
bool ParseDataChannelOpenMessage(const talk_base::Buffer& payload,
bool ParseDataChannelOpenMessage(const rtc::Buffer& payload,
std::string* label,
DataChannelInit* config);
bool ParseDataChannelOpenAckMessage(const talk_base::Buffer& payload);
bool ParseDataChannelOpenAckMessage(const rtc::Buffer& payload);
bool WriteDataChannelOpenMessage(const std::string& label,
const DataChannelInit& config,
talk_base::Buffer* payload);
rtc::Buffer* payload);
void WriteDataChannelOpenAckMessage(talk_base::Buffer* payload);
void WriteDataChannelOpenAckMessage(rtc::Buffer* payload);
} // namespace webrtc
#endif // TALK_APP_WEBRTC_SCTPUTILS_H_

View File

@ -25,13 +25,13 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "talk/base/bytebuffer.h"
#include "talk/base/gunit.h"
#include "webrtc/base/bytebuffer.h"
#include "webrtc/base/gunit.h"
#include "talk/app/webrtc/sctputils.h"
class SctpUtilsTest : public testing::Test {
public:
void VerifyOpenMessageFormat(const talk_base::Buffer& packet,
void VerifyOpenMessageFormat(const rtc::Buffer& packet,
const std::string& label,
const webrtc::DataChannelInit& config) {
uint8 message_type;
@ -41,7 +41,7 @@ class SctpUtilsTest : public testing::Test {
uint16 label_length;
uint16 protocol_length;
talk_base::ByteBuffer buffer(packet.data(), packet.length());
rtc::ByteBuffer buffer(packet.data(), packet.length());
ASSERT_TRUE(buffer.ReadUInt8(&message_type));
EXPECT_EQ(0x03, message_type);
@ -84,7 +84,7 @@ TEST_F(SctpUtilsTest, WriteParseOpenMessageWithOrderedReliable) {
std::string label = "abc";
config.protocol = "y";
talk_base::Buffer packet;
rtc::Buffer packet;
ASSERT_TRUE(webrtc::WriteDataChannelOpenMessage(label, config, &packet));
VerifyOpenMessageFormat(packet, label, config);
@ -108,7 +108,7 @@ TEST_F(SctpUtilsTest, WriteParseOpenMessageWithMaxRetransmitTime) {
config.maxRetransmitTime = 10;
config.protocol = "y";
talk_base::Buffer packet;
rtc::Buffer packet;
ASSERT_TRUE(webrtc::WriteDataChannelOpenMessage(label, config, &packet));
VerifyOpenMessageFormat(packet, label, config);
@ -131,7 +131,7 @@ TEST_F(SctpUtilsTest, WriteParseOpenMessageWithMaxRetransmits) {
config.maxRetransmits = 10;
config.protocol = "y";
talk_base::Buffer packet;
rtc::Buffer packet;
ASSERT_TRUE(webrtc::WriteDataChannelOpenMessage(label, config, &packet));
VerifyOpenMessageFormat(packet, label, config);
@ -149,11 +149,11 @@ TEST_F(SctpUtilsTest, WriteParseOpenMessageWithMaxRetransmits) {
}
TEST_F(SctpUtilsTest, WriteParseAckMessage) {
talk_base::Buffer packet;
rtc::Buffer packet;
webrtc::WriteDataChannelOpenAckMessage(&packet);
uint8 message_type;
talk_base::ByteBuffer buffer(packet.data(), packet.length());
rtc::ByteBuffer buffer(packet.data(), packet.length());
ASSERT_TRUE(buffer.ReadUInt8(&message_type));
EXPECT_EQ(0x02, message_type);

View File

@ -30,9 +30,9 @@
#include <utility>
#include <vector>
#include "talk/base/base64.h"
#include "talk/base/scoped_ptr.h"
#include "talk/base/timing.h"
#include "webrtc/base/base64.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/timing.h"
#include "talk/session/media/channel.h"
namespace webrtc {
@ -199,7 +199,7 @@ void StatsReport::AddValue(StatsReport::StatsValueName name,
}
void StatsReport::AddValue(StatsReport::StatsValueName name, int64 value) {
AddValue(name, talk_base::ToString<int64>(value));
AddValue(name, rtc::ToString<int64>(value));
}
template <typename T>
@ -208,7 +208,7 @@ void StatsReport::AddValue(StatsReport::StatsValueName name,
std::ostringstream oss;
oss << "[";
for (size_t i = 0; i < value.size(); ++i) {
oss << talk_base::ToString<T>(value[i]);
oss << rtc::ToString<T>(value[i]);
if (i != value.size() - 1)
oss << ", ";
}
@ -237,7 +237,7 @@ namespace {
typedef std::map<std::string, StatsReport> StatsMap;
double GetTimeNow() {
return talk_base::Timing::WallTimeNow() * talk_base::kNumMillisecsPerSec;
return rtc::Timing::WallTimeNow() * rtc::kNumMillisecsPerSec;
}
bool GetTransportIdFromProxy(const cricket::ProxyTransportMap& map,
@ -325,7 +325,7 @@ void ExtractStats(const cricket::VoiceReceiverInfo& info, StatsReport* report) {
report->AddValue(StatsReport::kStatsValueNameCurrentDelayMs,
info.delay_estimate_ms);
report->AddValue(StatsReport::kStatsValueNameExpandRate,
talk_base::ToString<float>(info.expand_rate));
rtc::ToString<float>(info.expand_rate));
report->AddValue(StatsReport::kStatsValueNamePacketsReceived,
info.packets_rcvd);
report->AddValue(StatsReport::kStatsValueNamePacketsLost,
@ -360,7 +360,7 @@ void ExtractStats(const cricket::VoiceSenderInfo& info, StatsReport* report) {
info.jitter_ms);
report->AddValue(StatsReport::kStatsValueNameRtt, info.rtt_ms);
report->AddValue(StatsReport::kStatsValueNameEchoCancellationQualityMin,
talk_base::ToString<float>(info.aec_quality_min));
rtc::ToString<float>(info.aec_quality_min));
report->AddValue(StatsReport::kStatsValueNameEchoDelayMedian,
info.echo_delay_median_ms);
report->AddValue(StatsReport::kStatsValueNameEchoDelayStdDev,
@ -671,7 +671,7 @@ StatsReport* StatsCollector::PrepareLocalReport(
uint32 ssrc,
const std::string& transport_id,
TrackDirection direction) {
const std::string ssrc_id = talk_base::ToString<uint32>(ssrc);
const std::string ssrc_id = rtc::ToString<uint32>(ssrc);
StatsMap::iterator it = reports_.find(StatsId(
StatsReport::kStatsReportTypeSsrc, ssrc_id, direction));
@ -714,7 +714,7 @@ StatsReport* StatsCollector::PrepareRemoteReport(
uint32 ssrc,
const std::string& transport_id,
TrackDirection direction) {
const std::string ssrc_id = talk_base::ToString<uint32>(ssrc);
const std::string ssrc_id = rtc::ToString<uint32>(ssrc);
StatsMap::iterator it = reports_.find(StatsId(
StatsReport::kStatsReportTypeRemoteSsrc, ssrc_id, direction));
@ -751,7 +751,7 @@ StatsReport* StatsCollector::PrepareRemoteReport(
}
std::string StatsCollector::AddOneCertificateReport(
const talk_base::SSLCertificate* cert, const std::string& issuer_id) {
const rtc::SSLCertificate* cert, const std::string& issuer_id) {
// TODO(bemasc): Move this computation to a helper class that caches these
// values to reduce CPU use in GetStats. This will require adding a fast
// SSLCertificate::Equals() method to detect certificate changes.
@ -760,8 +760,8 @@ std::string StatsCollector::AddOneCertificateReport(
if (!cert->GetSignatureDigestAlgorithm(&digest_algorithm))
return std::string();
talk_base::scoped_ptr<talk_base::SSLFingerprint> ssl_fingerprint(
talk_base::SSLFingerprint::Create(digest_algorithm, cert));
rtc::scoped_ptr<rtc::SSLFingerprint> ssl_fingerprint(
rtc::SSLFingerprint::Create(digest_algorithm, cert));
// SSLFingerprint::Create can fail if the algorithm returned by
// SSLCertificate::GetSignatureDigestAlgorithm is not supported by the
@ -772,10 +772,10 @@ std::string StatsCollector::AddOneCertificateReport(
std::string fingerprint = ssl_fingerprint->GetRfc4572Fingerprint();
talk_base::Buffer der_buffer;
rtc::Buffer der_buffer;
cert->ToDER(&der_buffer);
std::string der_base64;
talk_base::Base64::EncodeFromArray(
rtc::Base64::EncodeFromArray(
der_buffer.data(), der_buffer.length(), &der_base64);
StatsReport report;
@ -793,7 +793,7 @@ std::string StatsCollector::AddOneCertificateReport(
}
std::string StatsCollector::AddCertificateReports(
const talk_base::SSLCertificate* cert) {
const rtc::SSLCertificate* cert) {
// Produces a chain of StatsReports representing this certificate and the rest
// of its chain, and adds those reports to |reports_|. The return value is
// the id of the leaf report. The provided cert must be non-null, so at least
@ -802,14 +802,14 @@ std::string StatsCollector::AddCertificateReports(
ASSERT(cert != NULL);
std::string issuer_id;
talk_base::scoped_ptr<talk_base::SSLCertChain> chain;
rtc::scoped_ptr<rtc::SSLCertChain> chain;
if (cert->GetChain(chain.accept())) {
// This loop runs in reverse, i.e. from root to leaf, so that each
// certificate's issuer's report ID is known before the child certificate's
// report is generated. The root certificate does not have an issuer ID
// value.
for (ptrdiff_t i = chain->GetSize() - 1; i >= 0; --i) {
const talk_base::SSLCertificate& cert_i = chain->Get(i);
const rtc::SSLCertificate& cert_i = chain->Get(i);
issuer_id = AddOneCertificateReport(&cert_i, issuer_id);
}
}
@ -849,14 +849,14 @@ void StatsCollector::ExtractSessionInfo() {
cricket::Transport* transport =
session_->GetTransport(transport_iter->second.content_name);
talk_base::scoped_ptr<talk_base::SSLIdentity> identity;
rtc::scoped_ptr<rtc::SSLIdentity> identity;
if (transport && transport->GetIdentity(identity.accept())) {
local_cert_report_id =
AddCertificateReports(&(identity->certificate()));
}
transport = session_->GetTransport(transport_iter->second.content_name);
talk_base::scoped_ptr<talk_base::SSLCertificate> cert;
rtc::scoped_ptr<rtc::SSLCertificate> cert;
if (transport && transport->GetRemoteCertificate(cert.accept())) {
remote_cert_report_id = AddCertificateReports(cert.get());
}
@ -1018,7 +1018,7 @@ void StatsCollector::UpdateStatsFromExistingLocalAudioTracks() {
it != local_audio_tracks_.end(); ++it) {
AudioTrackInterface* track = it->first;
uint32 ssrc = it->second;
std::string ssrc_id = talk_base::ToString<uint32>(ssrc);
std::string ssrc_id = rtc::ToString<uint32>(ssrc);
StatsReport* report = GetReport(StatsReport::kStatsReportTypeSsrc,
ssrc_id,
kSending);
@ -1051,10 +1051,10 @@ void StatsCollector::UpdateReportFromAudioTrack(AudioTrackInterface* track,
int signal_level = 0;
if (track->GetSignalLevel(&signal_level)) {
report->ReplaceValue(StatsReport::kStatsValueNameAudioInputLevel,
talk_base::ToString<int>(signal_level));
rtc::ToString<int>(signal_level));
}
talk_base::scoped_refptr<AudioProcessorInterface> audio_processor(
rtc::scoped_refptr<AudioProcessorInterface> audio_processor(
track->GetAudioProcessor());
if (audio_processor.get() == NULL)
return;
@ -1064,16 +1064,16 @@ void StatsCollector::UpdateReportFromAudioTrack(AudioTrackInterface* track,
report->ReplaceValue(StatsReport::kStatsValueNameTypingNoiseState,
stats.typing_noise_detected ? "true" : "false");
report->ReplaceValue(StatsReport::kStatsValueNameEchoReturnLoss,
talk_base::ToString<int>(stats.echo_return_loss));
rtc::ToString<int>(stats.echo_return_loss));
report->ReplaceValue(
StatsReport::kStatsValueNameEchoReturnLossEnhancement,
talk_base::ToString<int>(stats.echo_return_loss_enhancement));
rtc::ToString<int>(stats.echo_return_loss_enhancement));
report->ReplaceValue(StatsReport::kStatsValueNameEchoDelayMedian,
talk_base::ToString<int>(stats.echo_delay_median_ms));
rtc::ToString<int>(stats.echo_delay_median_ms));
report->ReplaceValue(StatsReport::kStatsValueNameEchoCancellationQualityMin,
talk_base::ToString<float>(stats.aec_quality_min));
rtc::ToString<float>(stats.aec_quality_min));
report->ReplaceValue(StatsReport::kStatsValueNameEchoDelayStdDev,
talk_base::ToString<int>(stats.echo_delay_std_ms));
rtc::ToString<int>(stats.echo_delay_std_ms));
}
bool StatsCollector::GetTrackIdBySsrc(uint32 ssrc, std::string* track_id,

View File

@ -93,11 +93,11 @@ class StatsCollector {
// Helper method for AddCertificateReports.
std::string AddOneCertificateReport(
const talk_base::SSLCertificate* cert, const std::string& issuer_id);
const rtc::SSLCertificate* cert, const std::string& issuer_id);
// Adds a report for this certificate and every certificate in its chain, and
// returns the leaf certificate's report's ID.
std::string AddCertificateReports(const talk_base::SSLCertificate* cert);
std::string AddCertificateReports(const rtc::SSLCertificate* cert);
void ExtractSessionInfo();
void ExtractVoiceInfo();

View File

@ -33,9 +33,9 @@
#include "talk/app/webrtc/mediastreaminterface.h"
#include "talk/app/webrtc/mediastreamtrack.h"
#include "talk/app/webrtc/videotrack.h"
#include "talk/base/base64.h"
#include "talk/base/fakesslidentity.h"
#include "talk/base/gunit.h"
#include "webrtc/base/base64.h"
#include "webrtc/base/fakesslidentity.h"
#include "webrtc/base/gunit.h"
#include "talk/media/base/fakemediaengine.h"
#include "talk/media/devices/fakedevicemanager.h"
#include "talk/p2p/base/fakesession.h"
@ -75,8 +75,8 @@ const uint32 kSsrcOfTrack = 1234;
class MockWebRtcSession : public webrtc::WebRtcSession {
public:
explicit MockWebRtcSession(cricket::ChannelManager* channel_manager)
: WebRtcSession(channel_manager, talk_base::Thread::Current(),
talk_base::Thread::Current(), NULL, NULL) {
: WebRtcSession(channel_manager, rtc::Thread::Current(),
rtc::Thread::Current(), NULL, NULL) {
}
MOCK_METHOD0(voice_channel, cricket::VoiceChannel*());
MOCK_METHOD0(video_channel, cricket::VideoChannel*());
@ -126,7 +126,7 @@ class FakeAudioTrack
public:
explicit FakeAudioTrack(const std::string& id)
: webrtc::MediaStreamTrack<webrtc::AudioTrackInterface>(id),
processor_(new talk_base::RefCountedObject<FakeAudioProcessor>()) {}
processor_(new rtc::RefCountedObject<FakeAudioProcessor>()) {}
std::string kind() const OVERRIDE {
return "audio";
}
@ -139,13 +139,13 @@ class FakeAudioTrack
*level = 1;
return true;
}
virtual talk_base::scoped_refptr<webrtc::AudioProcessorInterface>
virtual rtc::scoped_refptr<webrtc::AudioProcessorInterface>
GetAudioProcessor() OVERRIDE {
return processor_;
}
private:
talk_base::scoped_refptr<FakeAudioProcessor> processor_;
rtc::scoped_refptr<FakeAudioProcessor> processor_;
};
bool GetValue(const StatsReport* report,
@ -216,8 +216,8 @@ std::string ExtractBweStatsValue(StatsReports reports,
}
std::string DerToPem(const std::string& der) {
return talk_base::SSLIdentity::DerToPem(
talk_base::kPemTypeCertificate,
return rtc::SSLIdentity::DerToPem(
rtc::kPemTypeCertificate,
reinterpret_cast<const unsigned char*>(der.c_str()),
der.length());
}
@ -241,8 +241,8 @@ void CheckCertChainReports(const StatsReports& reports,
std::string der_base64;
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameDer, &der_base64));
std::string der = talk_base::Base64::Decode(der_base64,
talk_base::Base64::DO_STRICT);
std::string der = rtc::Base64::Decode(der_base64,
rtc::Base64::DO_STRICT);
EXPECT_EQ(ders[i], der);
std::string fingerprint_algorithm;
@ -251,7 +251,7 @@ void CheckCertChainReports(const StatsReports& reports,
StatsReport::kStatsValueNameFingerprintAlgorithm,
&fingerprint_algorithm));
// The digest algorithm for a FakeSSLCertificate is always SHA-1.
std::string sha_1_str = talk_base::DIGEST_SHA_1;
std::string sha_1_str = rtc::DIGEST_SHA_1;
EXPECT_EQ(sha_1_str, fingerprint_algorithm);
std::string dummy_fingerprint; // Value is not checked.
@ -274,50 +274,50 @@ void VerifyVoiceReceiverInfoReport(
std::string value_in_report;
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameAudioOutputLevel, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(info.audio_level), value_in_report);
EXPECT_EQ(rtc::ToString<int>(info.audio_level), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameBytesReceived, &value_in_report));
EXPECT_EQ(talk_base::ToString<int64>(info.bytes_rcvd), value_in_report);
EXPECT_EQ(rtc::ToString<int64>(info.bytes_rcvd), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameJitterReceived, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(info.jitter_ms), value_in_report);
EXPECT_EQ(rtc::ToString<int>(info.jitter_ms), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameJitterBufferMs, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(info.jitter_buffer_ms), value_in_report);
EXPECT_EQ(rtc::ToString<int>(info.jitter_buffer_ms), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNamePreferredJitterBufferMs,
&value_in_report));
EXPECT_EQ(talk_base::ToString<int>(info.jitter_buffer_preferred_ms),
EXPECT_EQ(rtc::ToString<int>(info.jitter_buffer_preferred_ms),
value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameCurrentDelayMs, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(info.delay_estimate_ms), value_in_report);
EXPECT_EQ(rtc::ToString<int>(info.delay_estimate_ms), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameExpandRate, &value_in_report));
EXPECT_EQ(talk_base::ToString<float>(info.expand_rate), value_in_report);
EXPECT_EQ(rtc::ToString<float>(info.expand_rate), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNamePacketsReceived, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(info.packets_rcvd), value_in_report);
EXPECT_EQ(rtc::ToString<int>(info.packets_rcvd), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameDecodingCTSG, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(info.decoding_calls_to_silence_generator),
EXPECT_EQ(rtc::ToString<int>(info.decoding_calls_to_silence_generator),
value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameDecodingCTN, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(info.decoding_calls_to_neteq),
EXPECT_EQ(rtc::ToString<int>(info.decoding_calls_to_neteq),
value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameDecodingNormal, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(info.decoding_normal), value_in_report);
EXPECT_EQ(rtc::ToString<int>(info.decoding_normal), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameDecodingPLC, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(info.decoding_plc), value_in_report);
EXPECT_EQ(rtc::ToString<int>(info.decoding_plc), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameDecodingCNG, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(info.decoding_cng), value_in_report);
EXPECT_EQ(rtc::ToString<int>(info.decoding_cng), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameDecodingPLCCNG, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(info.decoding_plc_cng), value_in_report);
EXPECT_EQ(rtc::ToString<int>(info.decoding_plc_cng), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameCodecName, &value_in_report));
}
@ -331,46 +331,46 @@ void VerifyVoiceSenderInfoReport(const StatsReport* report,
EXPECT_EQ(sinfo.codec_name, value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameBytesSent, &value_in_report));
EXPECT_EQ(talk_base::ToString<int64>(sinfo.bytes_sent), value_in_report);
EXPECT_EQ(rtc::ToString<int64>(sinfo.bytes_sent), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNamePacketsSent, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(sinfo.packets_sent), value_in_report);
EXPECT_EQ(rtc::ToString<int>(sinfo.packets_sent), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNamePacketsLost, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(sinfo.packets_lost), value_in_report);
EXPECT_EQ(rtc::ToString<int>(sinfo.packets_lost), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameRtt, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(sinfo.rtt_ms), value_in_report);
EXPECT_EQ(rtc::ToString<int>(sinfo.rtt_ms), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameRtt, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(sinfo.rtt_ms), value_in_report);
EXPECT_EQ(rtc::ToString<int>(sinfo.rtt_ms), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameJitterReceived, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(sinfo.jitter_ms), value_in_report);
EXPECT_EQ(rtc::ToString<int>(sinfo.jitter_ms), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameEchoCancellationQualityMin,
&value_in_report));
EXPECT_EQ(talk_base::ToString<float>(sinfo.aec_quality_min), value_in_report);
EXPECT_EQ(rtc::ToString<float>(sinfo.aec_quality_min), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameEchoDelayMedian, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(sinfo.echo_delay_median_ms),
EXPECT_EQ(rtc::ToString<int>(sinfo.echo_delay_median_ms),
value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameEchoDelayStdDev, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(sinfo.echo_delay_std_ms),
EXPECT_EQ(rtc::ToString<int>(sinfo.echo_delay_std_ms),
value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameEchoReturnLoss, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(sinfo.echo_return_loss),
EXPECT_EQ(rtc::ToString<int>(sinfo.echo_return_loss),
value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameEchoReturnLossEnhancement,
&value_in_report));
EXPECT_EQ(talk_base::ToString<int>(sinfo.echo_return_loss_enhancement),
EXPECT_EQ(rtc::ToString<int>(sinfo.echo_return_loss_enhancement),
value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameAudioInputLevel, &value_in_report));
EXPECT_EQ(talk_base::ToString<int>(sinfo.audio_level), value_in_report);
EXPECT_EQ(rtc::ToString<int>(sinfo.audio_level), value_in_report);
EXPECT_TRUE(GetValue(
report, StatsReport::kStatsValueNameTypingNoiseState, &value_in_report));
std::string typing_detected = sinfo.typing_noise_detected ? "true" : "false";
@ -437,7 +437,7 @@ class StatsCollectorTest : public testing::Test {
channel_manager_(
new cricket::ChannelManager(media_engine_,
new cricket::FakeDeviceManager(),
talk_base::Thread::Current())),
rtc::Thread::Current())),
session_(channel_manager_.get()) {
// By default, we ignore session GetStats calls.
EXPECT_CALL(session_, GetStats(_)).WillRepeatedly(Return(false));
@ -481,7 +481,7 @@ class StatsCollectorTest : public testing::Test {
if (stream_ == NULL)
stream_ = webrtc::MediaStream::Create("streamlabel");
audio_track_ = new talk_base::RefCountedObject<FakeAudioTrack>(
audio_track_ = new rtc::RefCountedObject<FakeAudioTrack>(
kLocalTrackId);
stream_->AddTrack(audio_track_);
EXPECT_CALL(session_, GetLocalTrackIdBySsrc(kSsrcOfTrack, _))
@ -493,7 +493,7 @@ class StatsCollectorTest : public testing::Test {
if (stream_ == NULL)
stream_ = webrtc::MediaStream::Create("streamlabel");
audio_track_ = new talk_base::RefCountedObject<FakeAudioTrack>(
audio_track_ = new rtc::RefCountedObject<FakeAudioTrack>(
kRemoteTrackId);
stream_->AddTrack(audio_track_);
EXPECT_CALL(session_, GetRemoteTrackIdBySsrc(kSsrcOfTrack, _))
@ -546,7 +546,7 @@ class StatsCollectorTest : public testing::Test {
EXPECT_EQ(audio_track->id(), track_id);
std::string ssrc_id = ExtractSsrcStatsValue(
*reports, StatsReport::kStatsValueNameSsrc);
EXPECT_EQ(talk_base::ToString<uint32>(kSsrcOfTrack), ssrc_id);
EXPECT_EQ(rtc::ToString<uint32>(kSsrcOfTrack), ssrc_id);
// Verifies the values in the track report.
if (voice_sender_info) {
@ -568,16 +568,16 @@ class StatsCollectorTest : public testing::Test {
EXPECT_EQ(audio_track->id(), track_id);
ssrc_id = ExtractSsrcStatsValue(track_reports,
StatsReport::kStatsValueNameSsrc);
EXPECT_EQ(talk_base::ToString<uint32>(kSsrcOfTrack), ssrc_id);
EXPECT_EQ(rtc::ToString<uint32>(kSsrcOfTrack), ssrc_id);
if (voice_sender_info)
VerifyVoiceSenderInfoReport(track_report, *voice_sender_info);
if (voice_receiver_info)
VerifyVoiceReceiverInfoReport(track_report, *voice_receiver_info);
}
void TestCertificateReports(const talk_base::FakeSSLCertificate& local_cert,
void TestCertificateReports(const rtc::FakeSSLCertificate& local_cert,
const std::vector<std::string>& local_ders,
const talk_base::FakeSSLCertificate& remote_cert,
const rtc::FakeSSLCertificate& remote_cert,
const std::vector<std::string>& remote_ders) {
webrtc::StatsCollector stats(&session_); // Implementation under test.
StatsReports reports; // returned values.
@ -595,12 +595,12 @@ class StatsCollectorTest : public testing::Test {
transport_stats;
// Fake certificates to report.
talk_base::FakeSSLIdentity local_identity(local_cert);
talk_base::scoped_ptr<talk_base::FakeSSLCertificate> remote_cert_copy(
rtc::FakeSSLIdentity local_identity(local_cert);
rtc::scoped_ptr<rtc::FakeSSLCertificate> remote_cert_copy(
remote_cert.GetReference());
// Fake transport object.
talk_base::scoped_ptr<cricket::FakeTransport> transport(
rtc::scoped_ptr<cricket::FakeTransport> transport(
new cricket::FakeTransport(
session_.signaling_thread(),
session_.worker_thread(),
@ -655,19 +655,19 @@ class StatsCollectorTest : public testing::Test {
}
cricket::FakeMediaEngine* media_engine_;
talk_base::scoped_ptr<cricket::ChannelManager> channel_manager_;
rtc::scoped_ptr<cricket::ChannelManager> channel_manager_;
MockWebRtcSession session_;
cricket::SessionStats session_stats_;
talk_base::scoped_refptr<webrtc::MediaStream> stream_;
talk_base::scoped_refptr<webrtc::VideoTrack> track_;
talk_base::scoped_refptr<FakeAudioTrack> audio_track_;
rtc::scoped_refptr<webrtc::MediaStream> stream_;
rtc::scoped_refptr<webrtc::VideoTrack> track_;
rtc::scoped_refptr<FakeAudioTrack> audio_track_;
};
// This test verifies that 64-bit counters are passed successfully.
TEST_F(StatsCollectorTest, BytesCounterHandles64Bits) {
webrtc::StatsCollector stats(&session_); // Implementation under test.
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
cricket::VideoChannel video_channel(talk_base::Thread::Current(),
cricket::VideoChannel video_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, "", false, NULL);
StatsReports reports; // returned values.
cricket::VideoSenderInfo video_sender_info;
@ -700,7 +700,7 @@ TEST_F(StatsCollectorTest, BytesCounterHandles64Bits) {
TEST_F(StatsCollectorTest, BandwidthEstimationInfoIsReported) {
webrtc::StatsCollector stats(&session_); // Implementation under test.
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
cricket::VideoChannel video_channel(talk_base::Thread::Current(),
cricket::VideoChannel video_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, "", false, NULL);
StatsReports reports; // returned values.
cricket::VideoSenderInfo video_sender_info;
@ -776,7 +776,7 @@ TEST_F(StatsCollectorTest, OnlyOneSessionObjectExists) {
TEST_F(StatsCollectorTest, TrackObjectExistsWithoutUpdateStats) {
webrtc::StatsCollector stats(&session_); // Implementation under test.
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
cricket::VideoChannel video_channel(talk_base::Thread::Current(),
cricket::VideoChannel video_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, "", false, NULL);
AddOutgoingVideoTrackStats();
stats.AddStream(stream_);
@ -800,7 +800,7 @@ TEST_F(StatsCollectorTest, TrackObjectExistsWithoutUpdateStats) {
TEST_F(StatsCollectorTest, TrackAndSsrcObjectExistAfterUpdateSsrcStats) {
webrtc::StatsCollector stats(&session_); // Implementation under test.
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
cricket::VideoChannel video_channel(talk_base::Thread::Current(),
cricket::VideoChannel video_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, "", false, NULL);
AddOutgoingVideoTrackStats();
stats.AddStream(stream_);
@ -842,7 +842,7 @@ TEST_F(StatsCollectorTest, TrackAndSsrcObjectExistAfterUpdateSsrcStats) {
std::string ssrc_id = ExtractSsrcStatsValue(
reports, StatsReport::kStatsValueNameSsrc);
EXPECT_EQ(talk_base::ToString<uint32>(kSsrcOfTrack), ssrc_id);
EXPECT_EQ(rtc::ToString<uint32>(kSsrcOfTrack), ssrc_id);
std::string track_id = ExtractSsrcStatsValue(
reports, StatsReport::kStatsValueNameTrackId);
@ -859,7 +859,7 @@ TEST_F(StatsCollectorTest, TransportObjectLinkedFromSsrcObject) {
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
// The content_name known by the video channel.
const std::string kVcName("vcname");
cricket::VideoChannel video_channel(talk_base::Thread::Current(),
cricket::VideoChannel video_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, kVcName, false, NULL);
AddOutgoingVideoTrackStats();
stats.AddStream(stream_);
@ -905,7 +905,7 @@ TEST_F(StatsCollectorTest, RemoteSsrcInfoIsAbsent) {
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
// The content_name known by the video channel.
const std::string kVcName("vcname");
cricket::VideoChannel video_channel(talk_base::Thread::Current(),
cricket::VideoChannel video_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, kVcName, false, NULL);
AddOutgoingVideoTrackStats();
stats.AddStream(stream_);
@ -931,7 +931,7 @@ TEST_F(StatsCollectorTest, RemoteSsrcInfoIsPresent) {
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
// The content_name known by the video channel.
const std::string kVcName("vcname");
cricket::VideoChannel video_channel(talk_base::Thread::Current(),
cricket::VideoChannel video_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, kVcName, false, NULL);
AddOutgoingVideoTrackStats();
stats.AddStream(stream_);
@ -974,7 +974,7 @@ TEST_F(StatsCollectorTest, RemoteSsrcInfoIsPresent) {
TEST_F(StatsCollectorTest, ReportsFromRemoteTrack) {
webrtc::StatsCollector stats(&session_); // Implementation under test.
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
cricket::VideoChannel video_channel(talk_base::Thread::Current(),
cricket::VideoChannel video_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, "", false, NULL);
AddIncomingVideoTrackStats();
stats.AddStream(stream_);
@ -1007,7 +1007,7 @@ TEST_F(StatsCollectorTest, ReportsFromRemoteTrack) {
std::string ssrc_id = ExtractSsrcStatsValue(
reports, StatsReport::kStatsValueNameSsrc);
EXPECT_EQ(talk_base::ToString<uint32>(kSsrcOfTrack), ssrc_id);
EXPECT_EQ(rtc::ToString<uint32>(kSsrcOfTrack), ssrc_id);
std::string track_id = ExtractSsrcStatsValue(
reports, StatsReport::kStatsValueNameTrackId);
@ -1024,7 +1024,7 @@ TEST_F(StatsCollectorTest, ChainedCertificateReportsCreated) {
local_ders[2] = "some";
local_ders[3] = "der";
local_ders[4] = "values";
talk_base::FakeSSLCertificate local_cert(DersToPems(local_ders));
rtc::FakeSSLCertificate local_cert(DersToPems(local_ders));
// Build remote certificate chain
std::vector<std::string> remote_ders(4);
@ -1032,7 +1032,7 @@ TEST_F(StatsCollectorTest, ChainedCertificateReportsCreated) {
remote_ders[1] = "non-";
remote_ders[2] = "intersecting";
remote_ders[3] = "set";
talk_base::FakeSSLCertificate remote_cert(DersToPems(remote_ders));
rtc::FakeSSLCertificate remote_cert(DersToPems(remote_ders));
TestCertificateReports(local_cert, local_ders, remote_cert, remote_ders);
}
@ -1042,11 +1042,11 @@ TEST_F(StatsCollectorTest, ChainedCertificateReportsCreated) {
TEST_F(StatsCollectorTest, ChainlessCertificateReportsCreated) {
// Build local certificate.
std::string local_der = "This is the local der.";
talk_base::FakeSSLCertificate local_cert(DerToPem(local_der));
rtc::FakeSSLCertificate local_cert(DerToPem(local_der));
// Build remote certificate.
std::string remote_der = "This is somebody else's der.";
talk_base::FakeSSLCertificate remote_cert(DerToPem(remote_der));
rtc::FakeSSLCertificate remote_cert(DerToPem(remote_der));
TestCertificateReports(local_cert, std::vector<std::string>(1, local_der),
remote_cert, std::vector<std::string>(1, remote_der));
@ -1117,7 +1117,7 @@ TEST_F(StatsCollectorTest, NoCertificates) {
transport_stats;
// Fake transport object.
talk_base::scoped_ptr<cricket::FakeTransport> transport(
rtc::scoped_ptr<cricket::FakeTransport> transport(
new cricket::FakeTransport(
session_.signaling_thread(),
session_.worker_thread(),
@ -1155,11 +1155,11 @@ TEST_F(StatsCollectorTest, NoCertificates) {
TEST_F(StatsCollectorTest, UnsupportedDigestIgnored) {
// Build a local certificate.
std::string local_der = "This is the local der.";
talk_base::FakeSSLCertificate local_cert(DerToPem(local_der));
rtc::FakeSSLCertificate local_cert(DerToPem(local_der));
// Build a remote certificate with an unsupported digest algorithm.
std::string remote_der = "This is somebody else's der.";
talk_base::FakeSSLCertificate remote_cert(DerToPem(remote_der));
rtc::FakeSSLCertificate remote_cert(DerToPem(remote_der));
remote_cert.set_digest_algorithm("foobar");
TestCertificateReports(local_cert, std::vector<std::string>(1, local_der),
@ -1171,7 +1171,7 @@ TEST_F(StatsCollectorTest, UnsupportedDigestIgnored) {
TEST_F(StatsCollectorTest, StatsOutputLevelVerbose) {
webrtc::StatsCollector stats(&session_); // Implementation under test.
MockVideoMediaChannel* media_channel = new MockVideoMediaChannel();
cricket::VideoChannel video_channel(talk_base::Thread::Current(),
cricket::VideoChannel video_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, "", false, NULL);
cricket::VideoMediaInfo stats_read;
@ -1222,7 +1222,7 @@ TEST_F(StatsCollectorTest, GetStatsFromLocalAudioTrack) {
MockVoiceMediaChannel* media_channel = new MockVoiceMediaChannel();
// The content_name known by the voice channel.
const std::string kVcName("vcname");
cricket::VoiceChannel voice_channel(talk_base::Thread::Current(),
cricket::VoiceChannel voice_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, kVcName, false);
AddOutgoingAudioTrackStats();
stats.AddStream(stream_);
@ -1254,7 +1254,7 @@ TEST_F(StatsCollectorTest, GetStatsFromRemoteStream) {
MockVoiceMediaChannel* media_channel = new MockVoiceMediaChannel();
// The content_name known by the voice channel.
const std::string kVcName("vcname");
cricket::VoiceChannel voice_channel(talk_base::Thread::Current(),
cricket::VoiceChannel voice_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, kVcName, false);
AddIncomingAudioTrackStats();
stats.AddStream(stream_);
@ -1280,7 +1280,7 @@ TEST_F(StatsCollectorTest, GetStatsAfterRemoveAudioStream) {
MockVoiceMediaChannel* media_channel = new MockVoiceMediaChannel();
// The content_name known by the voice channel.
const std::string kVcName("vcname");
cricket::VoiceChannel voice_channel(talk_base::Thread::Current(),
cricket::VoiceChannel voice_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, kVcName, false);
AddOutgoingAudioTrackStats();
stats.AddStream(stream_);
@ -1319,7 +1319,7 @@ TEST_F(StatsCollectorTest, GetStatsAfterRemoveAudioStream) {
EXPECT_EQ(kLocalTrackId, track_id);
std::string ssrc_id = ExtractSsrcStatsValue(
reports, StatsReport::kStatsValueNameSsrc);
EXPECT_EQ(talk_base::ToString<uint32>(kSsrcOfTrack), ssrc_id);
EXPECT_EQ(rtc::ToString<uint32>(kSsrcOfTrack), ssrc_id);
// Verifies the values in the track report, no value will be changed by the
// AudioTrackInterface::GetSignalValue() and
@ -1337,7 +1337,7 @@ TEST_F(StatsCollectorTest, LocalAndRemoteTracksWithSameSsrc) {
MockVoiceMediaChannel* media_channel = new MockVoiceMediaChannel();
// The content_name known by the voice channel.
const std::string kVcName("vcname");
cricket::VoiceChannel voice_channel(talk_base::Thread::Current(),
cricket::VoiceChannel voice_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, kVcName, false);
// Create a local stream with a local audio track and adds it to the stats.
@ -1346,10 +1346,10 @@ TEST_F(StatsCollectorTest, LocalAndRemoteTracksWithSameSsrc) {
stats.AddLocalAudioTrack(audio_track_.get(), kSsrcOfTrack);
// Create a remote stream with a remote audio track and adds it to the stats.
talk_base::scoped_refptr<webrtc::MediaStream> remote_stream(
rtc::scoped_refptr<webrtc::MediaStream> remote_stream(
webrtc::MediaStream::Create("remotestreamlabel"));
talk_base::scoped_refptr<FakeAudioTrack> remote_track(
new talk_base::RefCountedObject<FakeAudioTrack>(kRemoteTrackId));
rtc::scoped_refptr<FakeAudioTrack> remote_track(
new rtc::RefCountedObject<FakeAudioTrack>(kRemoteTrackId));
EXPECT_CALL(session_, GetRemoteTrackIdBySsrc(kSsrcOfTrack, _))
.WillOnce(DoAll(SetArgPointee<1>(kRemoteTrackId), Return(true)));
remote_stream->AddTrack(remote_track);
@ -1418,7 +1418,7 @@ TEST_F(StatsCollectorTest, TwoLocalTracksWithSameSsrc) {
MockVoiceMediaChannel* media_channel = new MockVoiceMediaChannel();
// The content_name known by the voice channel.
const std::string kVcName("vcname");
cricket::VoiceChannel voice_channel(talk_base::Thread::Current(),
cricket::VoiceChannel voice_channel(rtc::Thread::Current(),
media_engine_, media_channel, &session_, kVcName, false);
// Create a local stream with a local audio track and adds it to the stats.
@ -1441,8 +1441,8 @@ TEST_F(StatsCollectorTest, TwoLocalTracksWithSameSsrc) {
// Create a new audio track and adds it to the stream and stats.
static const std::string kNewTrackId = "new_track_id";
talk_base::scoped_refptr<FakeAudioTrack> new_audio_track(
new talk_base::RefCountedObject<FakeAudioTrack>(kNewTrackId));
rtc::scoped_refptr<FakeAudioTrack> new_audio_track(
new rtc::RefCountedObject<FakeAudioTrack>(kNewTrackId));
EXPECT_CALL(session_, GetLocalTrackIdBySsrc(kSsrcOfTrack, _))
.WillOnce(DoAll(SetArgPointee<1>(kNewTrackId), Return(true)));
stream_->AddTrack(new_audio_track);

View File

@ -34,8 +34,8 @@
#include <string>
#include <vector>
#include "talk/base/basictypes.h"
#include "talk/base/stringencode.h"
#include "webrtc/base/basictypes.h"
#include "webrtc/base/stringencode.h"
namespace webrtc {

View File

@ -38,16 +38,16 @@ namespace webrtc {
// Implementation of StreamCollection.
class StreamCollection : public StreamCollectionInterface {
public:
static talk_base::scoped_refptr<StreamCollection> Create() {
talk_base::RefCountedObject<StreamCollection>* implementation =
new talk_base::RefCountedObject<StreamCollection>();
static rtc::scoped_refptr<StreamCollection> Create() {
rtc::RefCountedObject<StreamCollection>* implementation =
new rtc::RefCountedObject<StreamCollection>();
return implementation;
}
static talk_base::scoped_refptr<StreamCollection> Create(
static rtc::scoped_refptr<StreamCollection> Create(
StreamCollection* streams) {
talk_base::RefCountedObject<StreamCollection>* implementation =
new talk_base::RefCountedObject<StreamCollection>(streams);
rtc::RefCountedObject<StreamCollection>* implementation =
new rtc::RefCountedObject<StreamCollection>(streams);
return implementation;
}
@ -115,7 +115,7 @@ class StreamCollection : public StreamCollectionInterface {
explicit StreamCollection(StreamCollection* original)
: media_streams_(original->media_streams_) {
}
typedef std::vector<talk_base::scoped_refptr<MediaStreamInterface> >
typedef std::vector<rtc::scoped_refptr<MediaStreamInterface> >
StreamVector;
StreamVector media_streams_;
};

View File

@ -27,10 +27,10 @@
#include "talk/app/webrtc/test/fakeaudiocapturemodule.h"
#include "talk/base/common.h"
#include "talk/base/refcount.h"
#include "talk/base/thread.h"
#include "talk/base/timeutils.h"
#include "webrtc/base/common.h"
#include "webrtc/base/refcount.h"
#include "webrtc/base/thread.h"
#include "webrtc/base/timeutils.h"
// Audio sample value that is high enough that it doesn't occur naturally when
// frames are being faked. E.g. NetEq will not generate this large sample value
@ -58,7 +58,7 @@ enum {
};
FakeAudioCaptureModule::FakeAudioCaptureModule(
talk_base::Thread* process_thread)
rtc::Thread* process_thread)
: last_process_time_ms_(0),
audio_callback_(NULL),
recording_(false),
@ -77,12 +77,12 @@ FakeAudioCaptureModule::~FakeAudioCaptureModule() {
process_thread_->Send(this, MSG_STOP_PROCESS);
}
talk_base::scoped_refptr<FakeAudioCaptureModule> FakeAudioCaptureModule::Create(
talk_base::Thread* process_thread) {
rtc::scoped_refptr<FakeAudioCaptureModule> FakeAudioCaptureModule::Create(
rtc::Thread* process_thread) {
if (process_thread == NULL) return NULL;
talk_base::scoped_refptr<FakeAudioCaptureModule> capture_module(
new talk_base::RefCountedObject<FakeAudioCaptureModule>(process_thread));
rtc::scoped_refptr<FakeAudioCaptureModule> capture_module(
new rtc::RefCountedObject<FakeAudioCaptureModule>(process_thread));
if (!capture_module->Initialize()) {
return NULL;
}
@ -90,7 +90,7 @@ talk_base::scoped_refptr<FakeAudioCaptureModule> FakeAudioCaptureModule::Create(
}
int FakeAudioCaptureModule::frames_received() const {
talk_base::CritScope cs(&crit_);
rtc::CritScope cs(&crit_);
return frames_received_;
}
@ -102,7 +102,7 @@ int32_t FakeAudioCaptureModule::Version(char* /*version*/,
}
int32_t FakeAudioCaptureModule::TimeUntilNextProcess() {
const uint32 current_time = talk_base::Time();
const uint32 current_time = rtc::Time();
if (current_time < last_process_time_ms_) {
// TODO: wraparound could be handled more gracefully.
return 0;
@ -115,7 +115,7 @@ int32_t FakeAudioCaptureModule::TimeUntilNextProcess() {
}
int32_t FakeAudioCaptureModule::Process() {
last_process_time_ms_ = talk_base::Time();
last_process_time_ms_ = rtc::Time();
return 0;
}
@ -144,7 +144,7 @@ int32_t FakeAudioCaptureModule::RegisterEventObserver(
int32_t FakeAudioCaptureModule::RegisterAudioCallback(
webrtc::AudioTransport* audio_callback) {
talk_base::CritScope cs(&crit_callback_);
rtc::CritScope cs(&crit_callback_);
audio_callback_ = audio_callback;
return 0;
}
@ -249,7 +249,7 @@ int32_t FakeAudioCaptureModule::StartPlayout() {
return -1;
}
{
talk_base::CritScope cs(&crit_);
rtc::CritScope cs(&crit_);
playing_ = true;
}
bool start = true;
@ -260,7 +260,7 @@ int32_t FakeAudioCaptureModule::StartPlayout() {
int32_t FakeAudioCaptureModule::StopPlayout() {
bool start = false;
{
talk_base::CritScope cs(&crit_);
rtc::CritScope cs(&crit_);
playing_ = false;
start = ShouldStartProcessing();
}
@ -269,7 +269,7 @@ int32_t FakeAudioCaptureModule::StopPlayout() {
}
bool FakeAudioCaptureModule::Playing() const {
talk_base::CritScope cs(&crit_);
rtc::CritScope cs(&crit_);
return playing_;
}
@ -278,7 +278,7 @@ int32_t FakeAudioCaptureModule::StartRecording() {
return -1;
}
{
talk_base::CritScope cs(&crit_);
rtc::CritScope cs(&crit_);
recording_ = true;
}
bool start = true;
@ -289,7 +289,7 @@ int32_t FakeAudioCaptureModule::StartRecording() {
int32_t FakeAudioCaptureModule::StopRecording() {
bool start = false;
{
talk_base::CritScope cs(&crit_);
rtc::CritScope cs(&crit_);
recording_ = false;
start = ShouldStartProcessing();
}
@ -298,7 +298,7 @@ int32_t FakeAudioCaptureModule::StopRecording() {
}
bool FakeAudioCaptureModule::Recording() const {
talk_base::CritScope cs(&crit_);
rtc::CritScope cs(&crit_);
return recording_;
}
@ -397,13 +397,13 @@ int32_t FakeAudioCaptureModule::MicrophoneVolumeIsAvailable(
}
int32_t FakeAudioCaptureModule::SetMicrophoneVolume(uint32_t volume) {
talk_base::CritScope cs(&crit_);
rtc::CritScope cs(&crit_);
current_mic_level_ = volume;
return 0;
}
int32_t FakeAudioCaptureModule::MicrophoneVolume(uint32_t* volume) const {
talk_base::CritScope cs(&crit_);
rtc::CritScope cs(&crit_);
*volume = current_mic_level_;
return 0;
}
@ -617,7 +617,7 @@ int32_t FakeAudioCaptureModule::GetLoudspeakerStatus(bool* /*enabled*/) const {
return 0;
}
void FakeAudioCaptureModule::OnMessage(talk_base::Message* msg) {
void FakeAudioCaptureModule::OnMessage(rtc::Message* msg) {
switch (msg->message_id) {
case MSG_START_PROCESS:
StartProcessP();
@ -641,7 +641,7 @@ bool FakeAudioCaptureModule::Initialize() {
// sent to it. Note that the audio processing pipeline will likely distort the
// original signal.
SetSendBuffer(kHighSampleValue);
last_process_time_ms_ = talk_base::Time();
last_process_time_ms_ = rtc::Time();
return true;
}
@ -681,7 +681,7 @@ void FakeAudioCaptureModule::UpdateProcessing(bool start) {
}
void FakeAudioCaptureModule::StartProcessP() {
ASSERT(talk_base::Thread::Current() == process_thread_);
ASSERT(rtc::Thread::Current() == process_thread_);
if (started_) {
// Already started.
return;
@ -690,16 +690,16 @@ void FakeAudioCaptureModule::StartProcessP() {
}
void FakeAudioCaptureModule::ProcessFrameP() {
ASSERT(talk_base::Thread::Current() == process_thread_);
ASSERT(rtc::Thread::Current() == process_thread_);
if (!started_) {
next_frame_time_ = talk_base::Time();
next_frame_time_ = rtc::Time();
started_ = true;
}
bool playing;
bool recording;
{
talk_base::CritScope cs(&crit_);
rtc::CritScope cs(&crit_);
playing = playing_;
recording = recording_;
}
@ -713,16 +713,16 @@ void FakeAudioCaptureModule::ProcessFrameP() {
}
next_frame_time_ += kTimePerFrameMs;
const uint32 current_time = talk_base::Time();
const uint32 current_time = rtc::Time();
const uint32 wait_time = (next_frame_time_ > current_time) ?
next_frame_time_ - current_time : 0;
process_thread_->PostDelayed(wait_time, this, MSG_RUN_PROCESS);
}
void FakeAudioCaptureModule::ReceiveFrameP() {
ASSERT(talk_base::Thread::Current() == process_thread_);
ASSERT(rtc::Thread::Current() == process_thread_);
{
talk_base::CritScope cs(&crit_callback_);
rtc::CritScope cs(&crit_callback_);
if (!audio_callback_) {
return;
}
@ -753,14 +753,14 @@ void FakeAudioCaptureModule::ReceiveFrameP() {
// has been received from the remote side (i.e. faked frames are not being
// pulled).
if (CheckRecBuffer(kHighSampleValue)) {
talk_base::CritScope cs(&crit_);
rtc::CritScope cs(&crit_);
++frames_received_;
}
}
void FakeAudioCaptureModule::SendFrameP() {
ASSERT(talk_base::Thread::Current() == process_thread_);
talk_base::CritScope cs(&crit_callback_);
ASSERT(rtc::Thread::Current() == process_thread_);
rtc::CritScope cs(&crit_callback_);
if (!audio_callback_) {
return;
}
@ -780,7 +780,7 @@ void FakeAudioCaptureModule::SendFrameP() {
}
void FakeAudioCaptureModule::StopProcessP() {
ASSERT(talk_base::Thread::Current() == process_thread_);
ASSERT(rtc::Thread::Current() == process_thread_);
started_ = false;
process_thread_->Clear(this);
}

View File

@ -37,22 +37,22 @@
#ifndef TALK_APP_WEBRTC_TEST_FAKEAUDIOCAPTUREMODULE_H_
#define TALK_APP_WEBRTC_TEST_FAKEAUDIOCAPTUREMODULE_H_
#include "talk/base/basictypes.h"
#include "talk/base/criticalsection.h"
#include "talk/base/messagehandler.h"
#include "talk/base/scoped_ref_ptr.h"
#include "webrtc/base/basictypes.h"
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/messagehandler.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/audio_device/include/audio_device.h"
namespace talk_base {
namespace rtc {
class Thread;
} // namespace talk_base
} // namespace rtc
class FakeAudioCaptureModule
: public webrtc::AudioDeviceModule,
public talk_base::MessageHandler {
public rtc::MessageHandler {
public:
typedef uint16 Sample;
@ -64,8 +64,8 @@ class FakeAudioCaptureModule
// Creates a FakeAudioCaptureModule or returns NULL on failure.
// |process_thread| is used to push and pull audio frames to and from the
// returned instance. Note: ownership of |process_thread| is not handed over.
static talk_base::scoped_refptr<FakeAudioCaptureModule> Create(
talk_base::Thread* process_thread);
static rtc::scoped_refptr<FakeAudioCaptureModule> Create(
rtc::Thread* process_thread);
// Returns the number of frames that have been successfully pulled by the
// instance. Note that correctly detecting success can only be done if the
@ -201,8 +201,8 @@ class FakeAudioCaptureModule
virtual int32_t GetLoudspeakerStatus(bool* enabled) const;
// End of functions inherited from webrtc::AudioDeviceModule.
// The following function is inherited from talk_base::MessageHandler.
virtual void OnMessage(talk_base::Message* msg);
// The following function is inherited from rtc::MessageHandler.
virtual void OnMessage(rtc::Message* msg);
protected:
// The constructor is protected because the class needs to be created as a
@ -210,7 +210,7 @@ class FakeAudioCaptureModule
// exposed in which case the burden of proper instantiation would be put on
// the creator of a FakeAudioCaptureModule instance. To create an instance of
// this class use the Create(..) API.
explicit FakeAudioCaptureModule(talk_base::Thread* process_thread);
explicit FakeAudioCaptureModule(rtc::Thread* process_thread);
// The destructor is protected because it is reference counted and should not
// be deleted directly.
virtual ~FakeAudioCaptureModule();
@ -271,7 +271,7 @@ class FakeAudioCaptureModule
uint32 next_frame_time_;
// User provided thread context.
talk_base::Thread* process_thread_;
rtc::Thread* process_thread_;
// Buffer for storing samples received from the webrtc::AudioTransport.
char rec_buffer_[kNumberSamples * kNumberBytesPerSample];
@ -285,10 +285,10 @@ class FakeAudioCaptureModule
// Protects variables that are accessed from process_thread_ and
// the main thread.
mutable talk_base::CriticalSection crit_;
mutable rtc::CriticalSection crit_;
// Protects |audio_callback_| that is accessed from process_thread_ and
// the main thread.
talk_base::CriticalSection crit_callback_;
rtc::CriticalSection crit_callback_;
};
#endif // TALK_APP_WEBRTC_TEST_FAKEAUDIOCAPTUREMODULE_H_

View File

@ -29,9 +29,9 @@
#include <algorithm>
#include "talk/base/gunit.h"
#include "talk/base/scoped_ref_ptr.h"
#include "talk/base/thread.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/base/thread.h"
using std::min;
@ -49,7 +49,7 @@ class FakeAdmTest : public testing::Test,
virtual void SetUp() {
fake_audio_capture_module_ = FakeAudioCaptureModule::Create(
talk_base::Thread::Current());
rtc::Thread::Current());
EXPECT_TRUE(fake_audio_capture_module_.get() != NULL);
}
@ -109,7 +109,7 @@ class FakeAdmTest : public testing::Test,
int push_iterations() const { return push_iterations_; }
int pull_iterations() const { return pull_iterations_; }
talk_base::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
private:
bool RecordedDataReceived() const {

View File

@ -32,7 +32,7 @@
#include <vector>
#include "talk/app/webrtc/mediaconstraintsinterface.h"
#include "talk/base/stringencode.h"
#include "webrtc/base/stringencode.h"
namespace webrtc {
@ -51,7 +51,7 @@ class FakeConstraints : public webrtc::MediaConstraintsInterface {
template <class T>
void AddMandatory(const std::string& key, const T& value) {
mandatory_.push_back(Constraint(key, talk_base::ToString<T>(value)));
mandatory_.push_back(Constraint(key, rtc::ToString<T>(value)));
}
template <class T>
@ -66,12 +66,12 @@ class FakeConstraints : public webrtc::MediaConstraintsInterface {
}
}
}
mandatory_.push_back(Constraint(key, talk_base::ToString<T>(value)));
mandatory_.push_back(Constraint(key, rtc::ToString<T>(value)));
}
template <class T>
void AddOptional(const std::string& key, const T& value) {
optional_.push_back(Constraint(key, talk_base::ToString<T>(value)));
optional_.push_back(Constraint(key, rtc::ToString<T>(value)));
}
void SetMandatoryMinAspectRatio(double ratio) {

View File

@ -37,7 +37,7 @@ class FakeDataChannelProvider : public webrtc::DataChannelProviderInterface {
virtual ~FakeDataChannelProvider() {}
virtual bool SendData(const cricket::SendDataParams& params,
const talk_base::Buffer& payload,
const rtc::Buffer& payload,
cricket::SendDataResult* result) OVERRIDE {
ASSERT(ready_to_send_ && transport_available_);
if (send_blocked_) {

View File

@ -65,7 +65,7 @@ static const char kCERT_PEM[] =
using webrtc::DTLSIdentityRequestObserver;
class FakeIdentityService : public webrtc::DTLSIdentityServiceInterface,
public talk_base::MessageHandler {
public rtc::MessageHandler {
public:
struct Request {
Request(const std::string& common_name,
@ -73,9 +73,9 @@ class FakeIdentityService : public webrtc::DTLSIdentityServiceInterface,
: common_name(common_name), observer(observer) {}
std::string common_name;
talk_base::scoped_refptr<DTLSIdentityRequestObserver> observer;
rtc::scoped_refptr<DTLSIdentityRequestObserver> observer;
};
typedef talk_base::TypedMessageData<Request> MessageData;
typedef rtc::TypedMessageData<Request> MessageData;
FakeIdentityService() : should_fail_(false) {}
@ -89,9 +89,9 @@ class FakeIdentityService : public webrtc::DTLSIdentityServiceInterface,
DTLSIdentityRequestObserver* observer) {
MessageData* msg = new MessageData(Request(common_name, observer));
if (should_fail_) {
talk_base::Thread::Current()->Post(this, MSG_FAILURE, msg);
rtc::Thread::Current()->Post(this, MSG_FAILURE, msg);
} else {
talk_base::Thread::Current()->Post(this, MSG_SUCCESS, msg);
rtc::Thread::Current()->Post(this, MSG_SUCCESS, msg);
}
return true;
}
@ -102,8 +102,8 @@ class FakeIdentityService : public webrtc::DTLSIdentityServiceInterface,
MSG_FAILURE,
};
// talk_base::MessageHandler implementation.
void OnMessage(talk_base::Message* msg) {
// rtc::MessageHandler implementation.
void OnMessage(rtc::Message* msg) {
FakeIdentityService::MessageData* message_data =
static_cast<FakeIdentityService::MessageData*>(msg->pdata);
DTLSIdentityRequestObserver* observer = message_data->data().observer.get();
@ -125,8 +125,8 @@ class FakeIdentityService : public webrtc::DTLSIdentityServiceInterface,
const std::string& common_name,
std::string* der_cert,
std::string* der_key) {
talk_base::SSLIdentity::PemToDer("CERTIFICATE", kCERT_PEM, der_cert);
talk_base::SSLIdentity::PemToDer("RSA PRIVATE KEY",
rtc::SSLIdentity::PemToDer("CERTIFICATE", kCERT_PEM, der_cert);
rtc::SSLIdentity::PemToDer("RSA PRIVATE KEY",
kRSA_PRIVATE_KEY_PEM,
der_key);
}

View File

@ -45,7 +45,7 @@ class FakeMediaStreamSignaling : public webrtc::MediaStreamSignaling,
public webrtc::MediaStreamSignalingObserver {
public:
explicit FakeMediaStreamSignaling(cricket::ChannelManager* channel_manager) :
webrtc::MediaStreamSignaling(talk_base::Thread::Current(), this,
webrtc::MediaStreamSignaling(rtc::Thread::Current(), this,
channel_manager) {
}
@ -133,21 +133,21 @@ class FakeMediaStreamSignaling : public webrtc::MediaStreamSignaling,
}
private:
talk_base::scoped_refptr<webrtc::MediaStreamInterface> CreateStream(
rtc::scoped_refptr<webrtc::MediaStreamInterface> CreateStream(
const std::string& stream_label,
const std::string& audio_track_id,
const std::string& video_track_id) {
talk_base::scoped_refptr<webrtc::MediaStreamInterface> stream(
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream(
webrtc::MediaStream::Create(stream_label));
if (!audio_track_id.empty()) {
talk_base::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
webrtc::AudioTrack::Create(audio_track_id, NULL));
stream->AddTrack(audio_track);
}
if (!video_track_id.empty()) {
talk_base::scoped_refptr<webrtc::VideoTrackInterface> video_track(
rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track(
webrtc::VideoTrack::Create(video_track_id, NULL));
stream->AddTrack(video_track);
}

View File

@ -31,7 +31,7 @@
#ifndef TALK_APP_WEBRTC_TEST_FAKEPERIODICVIDEOCAPTURER_H_
#define TALK_APP_WEBRTC_TEST_FAKEPERIODICVIDEOCAPTURER_H_
#include "talk/base/thread.h"
#include "webrtc/base/thread.h"
#include "talk/media/base/fakevideocapturer.h"
namespace webrtc {
@ -56,20 +56,20 @@ class FakePeriodicVideoCapturer : public cricket::FakeVideoCapturer {
virtual cricket::CaptureState Start(const cricket::VideoFormat& format) {
cricket::CaptureState state = FakeVideoCapturer::Start(format);
if (state != cricket::CS_FAILED) {
talk_base::Thread::Current()->Post(this, MSG_CREATEFRAME);
rtc::Thread::Current()->Post(this, MSG_CREATEFRAME);
}
return state;
}
virtual void Stop() {
talk_base::Thread::Current()->Clear(this);
rtc::Thread::Current()->Clear(this);
}
// Inherited from MesageHandler.
virtual void OnMessage(talk_base::Message* msg) {
virtual void OnMessage(rtc::Message* msg) {
if (msg->message_id == MSG_CREATEFRAME) {
if (IsRunning()) {
CaptureFrame();
talk_base::Thread::Current()->PostDelayed(static_cast<int>(
GetCaptureFormat()->interval / talk_base::kNumNanosecsPerMillisec),
rtc::Thread::Current()->PostDelayed(static_cast<int>(
GetCaptureFormat()->interval / rtc::kNumNanosecsPerMillisec),
this, MSG_CREATEFRAME);
}
} else {

View File

@ -62,7 +62,7 @@ class FakeVideoTrackRenderer : public VideoRendererInterface {
private:
cricket::FakeVideoRenderer fake_renderer_;
talk_base::scoped_refptr<VideoTrackInterface> video_track_;
rtc::scoped_refptr<VideoTrackInterface> video_track_;
};
} // namespace webrtc

View File

@ -61,7 +61,7 @@ class MockCreateSessionDescriptionObserver
private:
bool called_;
bool result_;
talk_base::scoped_ptr<SessionDescriptionInterface> desc_;
rtc::scoped_ptr<SessionDescriptionInterface> desc_;
};
class MockSetSessionDescriptionObserver
@ -109,7 +109,7 @@ class MockDataChannelObserver : public webrtc::DataChannelObserver {
size_t received_message_count() const { return received_message_count_; }
private:
talk_base::scoped_refptr<webrtc::DataChannelInterface> channel_;
rtc::scoped_refptr<webrtc::DataChannelInterface> channel_;
DataChannelInterface::DataState state_;
std::string last_message_;
size_t received_message_count_;
@ -159,7 +159,7 @@ class MockStatsObserver : public webrtc::StatsObserver {
reports_[i].values.begin();
for (; it != reports_[i].values.end(); ++it) {
if (it->name == name) {
return talk_base::FromString<int>(it->value);
return rtc::FromString<int>(it->value);
}
}
}

View File

@ -31,7 +31,7 @@
#include "talk/app/webrtc/test/mockpeerconnectionobservers.h"
#include "talk/app/webrtc/test/peerconnectiontestwrapper.h"
#include "talk/app/webrtc/videosourceinterface.h"
#include "talk/base/gunit.h"
#include "webrtc/base/gunit.h"
static const char kStreamLabelBase[] = "stream_label";
static const char kVideoTrackLabelBase[] = "video_track";
@ -83,7 +83,7 @@ bool PeerConnectionTestWrapper::CreatePc(
}
peer_connection_factory_ = webrtc::CreatePeerConnectionFactory(
talk_base::Thread::Current(), talk_base::Thread::Current(),
rtc::Thread::Current(), rtc::Thread::Current(),
fake_audio_capture_module_, NULL, NULL);
if (!peer_connection_factory_) {
return false;
@ -95,7 +95,7 @@ bool PeerConnectionTestWrapper::CreatePc(
ice_server.uri = "stun:stun.l.google.com:19302";
ice_servers.push_back(ice_server);
FakeIdentityService* dtls_service =
talk_base::SSLStreamAdapter::HaveDtlsSrtp() ?
rtc::SSLStreamAdapter::HaveDtlsSrtp() ?
new FakeIdentityService() : NULL;
peer_connection_ = peer_connection_factory_->CreatePeerConnection(
ice_servers, constraints, allocator_factory_.get(), dtls_service, this);
@ -103,7 +103,7 @@ bool PeerConnectionTestWrapper::CreatePc(
return peer_connection_.get() != NULL;
}
talk_base::scoped_refptr<webrtc::DataChannelInterface>
rtc::scoped_refptr<webrtc::DataChannelInterface>
PeerConnectionTestWrapper::CreateDataChannel(
const std::string& label,
const webrtc::DataChannelInit& init) {
@ -136,7 +136,7 @@ void PeerConnectionTestWrapper::OnDataChannel(
void PeerConnectionTestWrapper::OnSuccess(SessionDescriptionInterface* desc) {
// This callback should take the ownership of |desc|.
talk_base::scoped_ptr<SessionDescriptionInterface> owned_desc(desc);
rtc::scoped_ptr<SessionDescriptionInterface> owned_desc(desc);
std::string sdp;
EXPECT_TRUE(desc->ToString(&sdp));
@ -179,8 +179,8 @@ void PeerConnectionTestWrapper::SetLocalDescription(const std::string& type,
LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
<< ": SetLocalDescription " << type << " " << sdp;
talk_base::scoped_refptr<MockSetSessionDescriptionObserver>
observer(new talk_base::RefCountedObject<
rtc::scoped_refptr<MockSetSessionDescriptionObserver>
observer(new rtc::RefCountedObject<
MockSetSessionDescriptionObserver>());
peer_connection_->SetLocalDescription(
observer, webrtc::CreateSessionDescription(type, sdp, NULL));
@ -191,8 +191,8 @@ void PeerConnectionTestWrapper::SetRemoteDescription(const std::string& type,
LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_
<< ": SetRemoteDescription " << type << " " << sdp;
talk_base::scoped_refptr<MockSetSessionDescriptionObserver>
observer(new talk_base::RefCountedObject<
rtc::scoped_refptr<MockSetSessionDescriptionObserver>
observer(new rtc::RefCountedObject<
MockSetSessionDescriptionObserver>());
peer_connection_->SetRemoteDescription(
observer, webrtc::CreateSessionDescription(type, sdp, NULL));
@ -201,7 +201,7 @@ void PeerConnectionTestWrapper::SetRemoteDescription(const std::string& type,
void PeerConnectionTestWrapper::AddIceCandidate(const std::string& sdp_mid,
int sdp_mline_index,
const std::string& candidate) {
talk_base::scoped_ptr<webrtc::IceCandidateInterface> owned_candidate(
rtc::scoped_ptr<webrtc::IceCandidateInterface> owned_candidate(
webrtc::CreateIceCandidate(sdp_mid, sdp_mline_index, candidate, NULL));
EXPECT_TRUE(peer_connection_->AddIceCandidate(owned_candidate.get()));
}
@ -252,19 +252,19 @@ bool PeerConnectionTestWrapper::CheckForVideo() {
void PeerConnectionTestWrapper::GetAndAddUserMedia(
bool audio, const webrtc::FakeConstraints& audio_constraints,
bool video, const webrtc::FakeConstraints& video_constraints) {
talk_base::scoped_refptr<webrtc::MediaStreamInterface> stream =
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream =
GetUserMedia(audio, audio_constraints, video, video_constraints);
EXPECT_TRUE(peer_connection_->AddStream(stream, NULL));
}
talk_base::scoped_refptr<webrtc::MediaStreamInterface>
rtc::scoped_refptr<webrtc::MediaStreamInterface>
PeerConnectionTestWrapper::GetUserMedia(
bool audio, const webrtc::FakeConstraints& audio_constraints,
bool video, const webrtc::FakeConstraints& video_constraints) {
std::string label = kStreamLabelBase +
talk_base::ToString<int>(
rtc::ToString<int>(
static_cast<int>(peer_connection_->local_streams()->count()));
talk_base::scoped_refptr<webrtc::MediaStreamInterface> stream =
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream =
peer_connection_factory_->CreateLocalMediaStream(label);
if (audio) {
@ -272,9 +272,9 @@ talk_base::scoped_refptr<webrtc::MediaStreamInterface>
// Disable highpass filter so that we can get all the test audio frames.
constraints.AddMandatory(
MediaConstraintsInterface::kHighpassFilter, false);
talk_base::scoped_refptr<webrtc::AudioSourceInterface> source =
rtc::scoped_refptr<webrtc::AudioSourceInterface> source =
peer_connection_factory_->CreateAudioSource(&constraints);
talk_base::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
peer_connection_factory_->CreateAudioTrack(kAudioTrackLabelBase,
source));
stream->AddTrack(audio_track);
@ -285,11 +285,11 @@ talk_base::scoped_refptr<webrtc::MediaStreamInterface>
FakeConstraints constraints = video_constraints;
constraints.SetMandatoryMaxFrameRate(10);
talk_base::scoped_refptr<webrtc::VideoSourceInterface> source =
rtc::scoped_refptr<webrtc::VideoSourceInterface> source =
peer_connection_factory_->CreateVideoSource(
new webrtc::FakePeriodicVideoCapturer(), &constraints);
std::string videotrack_label = label + kVideoTrackLabelBase;
talk_base::scoped_refptr<webrtc::VideoTrackInterface> video_track(
rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track(
peer_connection_factory_->CreateVideoTrack(videotrack_label, source));
stream->AddTrack(video_track);

View File

@ -32,8 +32,8 @@
#include "talk/app/webrtc/test/fakeaudiocapturemodule.h"
#include "talk/app/webrtc/test/fakeconstraints.h"
#include "talk/app/webrtc/test/fakevideotrackrenderer.h"
#include "talk/base/sigslot.h"
#include "talk/base/thread.h"
#include "webrtc/base/sigslot.h"
#include "webrtc/base/thread.h"
namespace webrtc {
class PortAllocatorFactoryInterface;
@ -52,7 +52,7 @@ class PeerConnectionTestWrapper
bool CreatePc(const webrtc::MediaConstraintsInterface* constraints);
talk_base::scoped_refptr<webrtc::DataChannelInterface> CreateDataChannel(
rtc::scoped_refptr<webrtc::DataChannelInterface> CreateDataChannel(
const std::string& label,
const webrtc::DataChannelInit& init);
@ -106,19 +106,19 @@ class PeerConnectionTestWrapper
bool CheckForConnection();
bool CheckForAudio();
bool CheckForVideo();
talk_base::scoped_refptr<webrtc::MediaStreamInterface> GetUserMedia(
rtc::scoped_refptr<webrtc::MediaStreamInterface> GetUserMedia(
bool audio, const webrtc::FakeConstraints& audio_constraints,
bool video, const webrtc::FakeConstraints& video_constraints);
std::string name_;
talk_base::Thread audio_thread_;
talk_base::scoped_refptr<webrtc::PortAllocatorFactoryInterface>
rtc::Thread audio_thread_;
rtc::scoped_refptr<webrtc::PortAllocatorFactoryInterface>
allocator_factory_;
talk_base::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
talk_base::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
peer_connection_factory_;
talk_base::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
talk_base::scoped_ptr<webrtc::FakeVideoTrackRenderer> renderer_;
rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
rtc::scoped_ptr<webrtc::FakeVideoTrackRenderer> renderer_;
};
#endif // TALK_APP_WEBRTC_TEST_PEERCONNECTIONTESTWRAPPER_H_

View File

@ -93,10 +93,10 @@ void SetUpperLimitFromConstraint(
const MediaConstraintsInterface::Constraint& constraint,
cricket::VideoFormat* format_upper_limit) {
if (constraint.key == MediaConstraintsInterface::kMaxWidth) {
int value = talk_base::FromString<int>(constraint.value);
int value = rtc::FromString<int>(constraint.value);
SetUpperLimit(value, &(format_upper_limit->width));
} else if (constraint.key == MediaConstraintsInterface::kMaxHeight) {
int value = talk_base::FromString<int>(constraint.value);
int value = rtc::FromString<int>(constraint.value);
SetUpperLimit(value, &(format_upper_limit->height));
}
}
@ -131,22 +131,22 @@ bool NewFormatWithConstraints(
*format_out = format_in;
if (constraint.key == MediaConstraintsInterface::kMinWidth) {
int value = talk_base::FromString<int>(constraint.value);
int value = rtc::FromString<int>(constraint.value);
return (value <= format_in.width);
} else if (constraint.key == MediaConstraintsInterface::kMaxWidth) {
int value = talk_base::FromString<int>(constraint.value);
int value = rtc::FromString<int>(constraint.value);
return (value >= format_in.width);
} else if (constraint.key == MediaConstraintsInterface::kMinHeight) {
int value = talk_base::FromString<int>(constraint.value);
int value = rtc::FromString<int>(constraint.value);
return (value <= format_in.height);
} else if (constraint.key == MediaConstraintsInterface::kMaxHeight) {
int value = talk_base::FromString<int>(constraint.value);
int value = rtc::FromString<int>(constraint.value);
return (value >= format_in.height);
} else if (constraint.key == MediaConstraintsInterface::kMinFrameRate) {
int value = talk_base::FromString<int>(constraint.value);
int value = rtc::FromString<int>(constraint.value);
return (value <= cricket::VideoFormat::IntervalToFps(format_in.interval));
} else if (constraint.key == MediaConstraintsInterface::kMaxFrameRate) {
int value = talk_base::FromString<int>(constraint.value);
int value = rtc::FromString<int>(constraint.value);
if (value == 0) {
if (mandatory) {
// TODO(ronghuawu): Convert the constraint value to float when sub-1fps
@ -163,7 +163,7 @@ bool NewFormatWithConstraints(
return false;
}
} else if (constraint.key == MediaConstraintsInterface::kMinAspectRatio) {
double value = talk_base::FromString<double>(constraint.value);
double value = rtc::FromString<double>(constraint.value);
// The aspect ratio in |constraint.value| has been converted to a string and
// back to a double, so it may have a rounding error.
// E.g if the value 1/3 is converted to a string, the string will not have
@ -173,7 +173,7 @@ bool NewFormatWithConstraints(
double ratio = static_cast<double>(format_in.width) / format_in.height;
return (value <= ratio + kRoundingTruncation);
} else if (constraint.key == MediaConstraintsInterface::kMaxAspectRatio) {
double value = talk_base::FromString<double>(constraint.value);
double value = rtc::FromString<double>(constraint.value);
double ratio = static_cast<double>(format_in.width) / format_in.height;
// Subtract 0.0005 to avoid rounding problems. Same as above.
const double kRoundingTruncation = 0.0005;
@ -337,14 +337,14 @@ class FrameInputWrapper : public cricket::VideoRenderer {
namespace webrtc {
talk_base::scoped_refptr<VideoSource> VideoSource::Create(
rtc::scoped_refptr<VideoSource> VideoSource::Create(
cricket::ChannelManager* channel_manager,
cricket::VideoCapturer* capturer,
const webrtc::MediaConstraintsInterface* constraints) {
ASSERT(channel_manager != NULL);
ASSERT(capturer != NULL);
talk_base::scoped_refptr<VideoSource> source(
new talk_base::RefCountedObject<VideoSource>(channel_manager,
rtc::scoped_refptr<VideoSource> source(
new rtc::RefCountedObject<VideoSource>(channel_manager,
capturer));
source->Initialize(constraints);
return source;

Some files were not shown because too many files have changed in this diff Show More