Rename VideoCall to Call.
Call should encompass more than video, there's no point in calling it VideoCall. BUG= R=mflodman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2191005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4704 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
86136a0e8f
commit
841c8a44bb
@ -8,7 +8,7 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "webrtc/video_engine/internal/video_call.h"
|
#include "webrtc/video_engine/internal/call.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -24,17 +24,16 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
VideoCall* VideoCall::Create(const VideoCall::Config& config) {
|
Call* Call::Create(const Call::Config& config) {
|
||||||
webrtc::VideoEngine* video_engine = webrtc::VideoEngine::Create();
|
VideoEngine* video_engine = VideoEngine::Create();
|
||||||
assert(video_engine != NULL);
|
assert(video_engine != NULL);
|
||||||
|
|
||||||
return new internal::VideoCall(video_engine, config);
|
return new internal::Call(video_engine, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
VideoCall::VideoCall(webrtc::VideoEngine* video_engine,
|
Call::Call(webrtc::VideoEngine* video_engine, const Call::Config& config)
|
||||||
const VideoCall::Config& config)
|
|
||||||
: config_(config),
|
: config_(config),
|
||||||
receive_lock_(RWLockWrapper::CreateRWLock()),
|
receive_lock_(RWLockWrapper::CreateRWLock()),
|
||||||
send_lock_(RWLockWrapper::CreateRWLock()),
|
send_lock_(RWLockWrapper::CreateRWLock()),
|
||||||
@ -50,15 +49,15 @@ VideoCall::VideoCall(webrtc::VideoEngine* video_engine,
|
|||||||
assert(codec_ != NULL);
|
assert(codec_ != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoCall::~VideoCall() {
|
Call::~Call() {
|
||||||
codec_->Release();
|
codec_->Release();
|
||||||
rtp_rtcp_->Release();
|
rtp_rtcp_->Release();
|
||||||
webrtc::VideoEngine::Delete(video_engine_);
|
webrtc::VideoEngine::Delete(video_engine_);
|
||||||
}
|
}
|
||||||
|
|
||||||
PacketReceiver* VideoCall::Receiver() { return this; }
|
PacketReceiver* Call::Receiver() { return this; }
|
||||||
|
|
||||||
std::vector<VideoCodec> VideoCall::GetVideoCodecs() {
|
std::vector<VideoCodec> Call::GetVideoCodecs() {
|
||||||
std::vector<VideoCodec> codecs;
|
std::vector<VideoCodec> codecs;
|
||||||
|
|
||||||
VideoCodec codec;
|
VideoCodec codec;
|
||||||
@ -70,14 +69,13 @@ std::vector<VideoCodec> VideoCall::GetVideoCodecs() {
|
|||||||
return codecs;
|
return codecs;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoSendStream::Config VideoCall::GetDefaultSendConfig() {
|
VideoSendStream::Config Call::GetDefaultSendConfig() {
|
||||||
VideoSendStream::Config config;
|
VideoSendStream::Config config;
|
||||||
codec_->GetCodec(0, config.codec);
|
codec_->GetCodec(0, config.codec);
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoSendStream* VideoCall::CreateSendStream(
|
VideoSendStream* Call::CreateSendStream(const VideoSendStream::Config& config) {
|
||||||
const VideoSendStream::Config& config) {
|
|
||||||
assert(config.rtp.ssrcs.size() > 0);
|
assert(config.rtp.ssrcs.size() > 0);
|
||||||
assert(config.codec.numberOfSimulcastStreams == 0 ||
|
assert(config.codec.numberOfSimulcastStreams == 0 ||
|
||||||
config.codec.numberOfSimulcastStreams == config.rtp.ssrcs.size());
|
config.codec.numberOfSimulcastStreams == config.rtp.ssrcs.size());
|
||||||
@ -93,8 +91,7 @@ VideoSendStream* VideoCall::CreateSendStream(
|
|||||||
return send_stream;
|
return send_stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
SendStreamState* VideoCall::DestroySendStream(
|
SendStreamState* Call::DestroySendStream(webrtc::VideoSendStream* send_stream) {
|
||||||
webrtc::VideoSendStream* send_stream) {
|
|
||||||
assert(send_stream != NULL);
|
assert(send_stream != NULL);
|
||||||
|
|
||||||
VideoSendStream* send_stream_impl = NULL;
|
VideoSendStream* send_stream_impl = NULL;
|
||||||
@ -119,11 +116,11 @@ SendStreamState* VideoCall::DestroySendStream(
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoReceiveStream::Config VideoCall::GetDefaultReceiveConfig() {
|
VideoReceiveStream::Config Call::GetDefaultReceiveConfig() {
|
||||||
return VideoReceiveStream::Config();
|
return VideoReceiveStream::Config();
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoReceiveStream* VideoCall::CreateReceiveStream(
|
VideoReceiveStream* Call::CreateReceiveStream(
|
||||||
const VideoReceiveStream::Config& config) {
|
const VideoReceiveStream::Config& config) {
|
||||||
VideoReceiveStream* receive_stream =
|
VideoReceiveStream* receive_stream =
|
||||||
new VideoReceiveStream(video_engine_, config, config_.send_transport);
|
new VideoReceiveStream(video_engine_, config, config_.send_transport);
|
||||||
@ -134,8 +131,7 @@ VideoReceiveStream* VideoCall::CreateReceiveStream(
|
|||||||
return receive_stream;
|
return receive_stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoCall::DestroyReceiveStream(
|
void Call::DestroyReceiveStream(webrtc::VideoReceiveStream* receive_stream) {
|
||||||
webrtc::VideoReceiveStream* receive_stream) {
|
|
||||||
assert(receive_stream != NULL);
|
assert(receive_stream != NULL);
|
||||||
|
|
||||||
VideoReceiveStream* receive_stream_impl = NULL;
|
VideoReceiveStream* receive_stream_impl = NULL;
|
||||||
@ -157,17 +153,17 @@ void VideoCall::DestroyReceiveStream(
|
|||||||
delete receive_stream_impl;
|
delete receive_stream_impl;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t VideoCall::SendBitrateEstimate() {
|
uint32_t Call::SendBitrateEstimate() {
|
||||||
// TODO(pbos): Return send-bitrate estimate
|
// TODO(pbos): Return send-bitrate estimate
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t VideoCall::ReceiveBitrateEstimate() {
|
uint32_t Call::ReceiveBitrateEstimate() {
|
||||||
// TODO(pbos): Return receive-bitrate estimate
|
// TODO(pbos): Return receive-bitrate estimate
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VideoCall::DeliverRtcp(const uint8_t* packet, size_t length) {
|
bool Call::DeliverRtcp(const uint8_t* packet, size_t length) {
|
||||||
// TODO(pbos): Figure out what channel needs it actually.
|
// TODO(pbos): Figure out what channel needs it actually.
|
||||||
// Do NOT broadcast! Also make sure it's a valid packet.
|
// Do NOT broadcast! Also make sure it's a valid packet.
|
||||||
bool rtcp_delivered = false;
|
bool rtcp_delivered = false;
|
||||||
@ -199,9 +195,9 @@ bool VideoCall::DeliverRtcp(const uint8_t* packet, size_t length) {
|
|||||||
return rtcp_delivered;
|
return rtcp_delivered;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VideoCall::DeliverRtp(const RTPHeader& header,
|
bool Call::DeliverRtp(const RTPHeader& header,
|
||||||
const uint8_t* packet,
|
const uint8_t* packet,
|
||||||
size_t length) {
|
size_t length) {
|
||||||
VideoReceiveStream* receiver;
|
VideoReceiveStream* receiver;
|
||||||
{
|
{
|
||||||
ReadLockScoped read_lock(*receive_lock_);
|
ReadLockScoped read_lock(*receive_lock_);
|
||||||
@ -217,7 +213,7 @@ bool VideoCall::DeliverRtp(const RTPHeader& header,
|
|||||||
return receiver->DeliverRtp(static_cast<const uint8_t*>(packet), length);
|
return receiver->DeliverRtp(static_cast<const uint8_t*>(packet), length);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VideoCall::DeliverPacket(const uint8_t* packet, size_t length) {
|
bool Call::DeliverPacket(const uint8_t* packet, size_t length) {
|
||||||
// TODO(pbos): ExtensionMap if there are extensions.
|
// TODO(pbos): ExtensionMap if there are extensions.
|
||||||
if (RtpHeaderParser::IsRtcp(packet, static_cast<int>(length)))
|
if (RtpHeaderParser::IsRtcp(packet, static_cast<int>(length)))
|
||||||
return DeliverRtcp(packet, length);
|
return DeliverRtcp(packet, length);
|
@ -7,8 +7,8 @@
|
|||||||
* in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
#ifndef WEBRTC_VIDEO_ENGINE_VIDEO_CALL_IMPL_H_
|
#ifndef WEBRTC_VIDEO_ENGINE_CALL_IMPL_H_
|
||||||
#define WEBRTC_VIDEO_ENGINE_VIDEO_CALL_IMPL_H_
|
#define WEBRTC_VIDEO_ENGINE_CALL_IMPL_H_
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -18,7 +18,7 @@
|
|||||||
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
||||||
#include "webrtc/video_engine/internal/video_receive_stream.h"
|
#include "webrtc/video_engine/internal/video_receive_stream.h"
|
||||||
#include "webrtc/video_engine/internal/video_send_stream.h"
|
#include "webrtc/video_engine/internal/video_send_stream.h"
|
||||||
#include "webrtc/video_engine/new_include/video_call.h"
|
#include "webrtc/video_engine/new_include/call.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
@ -30,11 +30,10 @@ namespace internal {
|
|||||||
|
|
||||||
// TODO(pbos): Split out the packet receiver, should be sharable between
|
// TODO(pbos): Split out the packet receiver, should be sharable between
|
||||||
// VideoEngine and VoiceEngine.
|
// VideoEngine and VoiceEngine.
|
||||||
class VideoCall : public webrtc::VideoCall, public PacketReceiver {
|
class Call : public webrtc::Call, public PacketReceiver {
|
||||||
public:
|
public:
|
||||||
VideoCall(webrtc::VideoEngine* video_engine,
|
Call(webrtc::VideoEngine* video_engine, const Call::Config& config);
|
||||||
const VideoCall::Config& config);
|
virtual ~Call();
|
||||||
virtual ~VideoCall();
|
|
||||||
|
|
||||||
virtual PacketReceiver* Receiver() OVERRIDE;
|
virtual PacketReceiver* Receiver() OVERRIDE;
|
||||||
virtual std::vector<VideoCodec> GetVideoCodecs() OVERRIDE;
|
virtual std::vector<VideoCodec> GetVideoCodecs() OVERRIDE;
|
||||||
@ -52,8 +51,8 @@ class VideoCall : public webrtc::VideoCall, public PacketReceiver {
|
|||||||
virtual VideoReceiveStream* CreateReceiveStream(
|
virtual VideoReceiveStream* CreateReceiveStream(
|
||||||
const VideoReceiveStream::Config& config) OVERRIDE;
|
const VideoReceiveStream::Config& config) OVERRIDE;
|
||||||
|
|
||||||
virtual void DestroyReceiveStream(webrtc::VideoReceiveStream* receive_stream)
|
virtual void DestroyReceiveStream(
|
||||||
OVERRIDE;
|
webrtc::VideoReceiveStream* receive_stream) OVERRIDE;
|
||||||
|
|
||||||
virtual uint32_t SendBitrateEstimate() OVERRIDE;
|
virtual uint32_t SendBitrateEstimate() OVERRIDE;
|
||||||
virtual uint32_t ReceiveBitrateEstimate() OVERRIDE;
|
virtual uint32_t ReceiveBitrateEstimate() OVERRIDE;
|
||||||
@ -66,7 +65,7 @@ class VideoCall : public webrtc::VideoCall, public PacketReceiver {
|
|||||||
const uint8_t* packet,
|
const uint8_t* packet,
|
||||||
size_t length);
|
size_t length);
|
||||||
|
|
||||||
VideoCall::Config config_;
|
Call::Config config_;
|
||||||
|
|
||||||
std::map<uint32_t, VideoReceiveStream*> receive_ssrcs_;
|
std::map<uint32_t, VideoReceiveStream*> receive_ssrcs_;
|
||||||
scoped_ptr<RWLockWrapper> receive_lock_;
|
scoped_ptr<RWLockWrapper> receive_lock_;
|
||||||
@ -80,9 +79,9 @@ class VideoCall : public webrtc::VideoCall, public PacketReceiver {
|
|||||||
ViERTP_RTCP* rtp_rtcp_;
|
ViERTP_RTCP* rtp_rtcp_;
|
||||||
ViECodec* codec_;
|
ViECodec* codec_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(VideoCall);
|
DISALLOW_COPY_AND_ASSIGN(Call);
|
||||||
};
|
};
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // WEBRTC_VIDEO_ENGINE_INTERNAL_VIDEO_CALL_H_
|
#endif // WEBRTC_VIDEO_ENGINE_INTERNAL_CALL_H_
|
@ -7,8 +7,8 @@
|
|||||||
* in the file PATENTS. All contributing project authors may
|
* in the file PATENTS. All contributing project authors may
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
#ifndef WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_CALL_H_
|
#ifndef WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CALL_H_
|
||||||
#define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_CALL_H_
|
#define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CALL_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -31,10 +31,10 @@ class PacketReceiver {
|
|||||||
virtual ~PacketReceiver() {}
|
virtual ~PacketReceiver() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
// A VideoCall instance can contain several send and/or receive streams. All
|
// A Call instance can contain several send and/or receive streams. All streams
|
||||||
// streams are assumed to have the same remote endpoint and will share bitrate
|
// are assumed to have the same remote endpoint and will share bitrate estimates
|
||||||
// estimates etc.
|
// etc.
|
||||||
class VideoCall {
|
class Call {
|
||||||
public:
|
public:
|
||||||
struct Config {
|
struct Config {
|
||||||
explicit Config(newapi::Transport* send_transport)
|
explicit Config(newapi::Transport* send_transport)
|
||||||
@ -47,14 +47,14 @@ class VideoCall {
|
|||||||
newapi::Transport* send_transport;
|
newapi::Transport* send_transport;
|
||||||
bool overuse_detection;
|
bool overuse_detection;
|
||||||
|
|
||||||
// VoiceEngine used for audio/video synchronization for this VideoCall.
|
// VoiceEngine used for audio/video synchronization for this Call.
|
||||||
VoiceEngine* voice_engine;
|
VoiceEngine* voice_engine;
|
||||||
|
|
||||||
TraceCallback* trace_callback;
|
TraceCallback* trace_callback;
|
||||||
uint32_t trace_filter;
|
uint32_t trace_filter;
|
||||||
};
|
};
|
||||||
|
|
||||||
static VideoCall* Create(const VideoCall::Config& config);
|
static Call* Create(const Call::Config& config);
|
||||||
|
|
||||||
virtual std::vector<VideoCodec> GetVideoCodecs() = 0;
|
virtual std::vector<VideoCodec> GetVideoCodecs() = 0;
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ class VideoCall {
|
|||||||
|
|
||||||
// All received RTP and RTCP packets for the call should be inserted to this
|
// All received RTP and RTCP packets for the call should be inserted to this
|
||||||
// PacketReceiver. The PacketReceiver pointer is valid as long as the
|
// PacketReceiver. The PacketReceiver pointer is valid as long as the
|
||||||
// VideoCall instance exists.
|
// Call instance exists.
|
||||||
virtual PacketReceiver* Receiver() = 0;
|
virtual PacketReceiver* Receiver() = 0;
|
||||||
|
|
||||||
// Returns the estimated total send bandwidth. Note: this can differ from the
|
// Returns the estimated total send bandwidth. Note: this can differ from the
|
||||||
@ -87,8 +87,8 @@ class VideoCall {
|
|||||||
// differ from the actual receive bitrate.
|
// differ from the actual receive bitrate.
|
||||||
virtual uint32_t ReceiveBitrateEstimate() = 0;
|
virtual uint32_t ReceiveBitrateEstimate() = 0;
|
||||||
|
|
||||||
virtual ~VideoCall() {}
|
virtual ~Call() {}
|
||||||
};
|
};
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_CALL_H_
|
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CALL_H_
|
@ -10,7 +10,7 @@
|
|||||||
#include "webrtc/video_engine/test/common/direct_transport.h"
|
#include "webrtc/video_engine/test/common/direct_transport.h"
|
||||||
|
|
||||||
#include "testing/gtest/include/gtest/gtest.h"
|
#include "testing/gtest/include/gtest/gtest.h"
|
||||||
#include "webrtc/video_engine/new_include/video_call.h"
|
#include "webrtc/video_engine/new_include/call.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||||
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
||||||
#include "webrtc/system_wrappers/interface/event_wrapper.h"
|
#include "webrtc/system_wrappers/interface/event_wrapper.h"
|
||||||
#include "webrtc/video_engine/new_include/video_call.h"
|
#include "webrtc/video_engine/new_include/call.h"
|
||||||
#include "webrtc/video_engine/test/common/direct_transport.h"
|
#include "webrtc/video_engine/test/common/direct_transport.h"
|
||||||
#include "webrtc/video_engine/test/common/fake_decoder.h"
|
#include "webrtc/video_engine/test/common/fake_decoder.h"
|
||||||
#include "webrtc/video_engine/test/common/fake_encoder.h"
|
#include "webrtc/video_engine/test/common/fake_encoder.h"
|
||||||
@ -35,7 +35,8 @@ namespace webrtc {
|
|||||||
class StreamObserver : public newapi::Transport, public RemoteBitrateObserver {
|
class StreamObserver : public newapi::Transport, public RemoteBitrateObserver {
|
||||||
public:
|
public:
|
||||||
typedef std::map<uint32_t, int> BytesSentMap;
|
typedef std::map<uint32_t, int> BytesSentMap;
|
||||||
StreamObserver(int num_expected_ssrcs, newapi::Transport* feedback_transport,
|
StreamObserver(int num_expected_ssrcs,
|
||||||
|
newapi::Transport* feedback_transport,
|
||||||
Clock* clock)
|
Clock* clock)
|
||||||
: critical_section_(CriticalSectionWrapper::CreateCriticalSection()),
|
: critical_section_(CriticalSectionWrapper::CreateCriticalSection()),
|
||||||
all_ssrcs_sent_(EventWrapper::Create()),
|
all_ssrcs_sent_(EventWrapper::Create()),
|
||||||
@ -65,21 +66,19 @@ class StreamObserver : public newapi::Transport, public RemoteBitrateObserver {
|
|||||||
CriticalSectionScoped lock(critical_section_.get());
|
CriticalSectionScoped lock(critical_section_.get());
|
||||||
if (ssrcs.size() == num_expected_ssrcs_ && bitrate >= kExpectedBitrateBps)
|
if (ssrcs.size() == num_expected_ssrcs_ && bitrate >= kExpectedBitrateBps)
|
||||||
all_ssrcs_sent_->Set();
|
all_ssrcs_sent_->Set();
|
||||||
rtp_rtcp_->SetREMBData(bitrate, static_cast<uint8_t>(ssrcs.size()),
|
rtp_rtcp_->SetREMBData(
|
||||||
&ssrcs[0]);
|
bitrate, static_cast<uint8_t>(ssrcs.size()), &ssrcs[0]);
|
||||||
rtp_rtcp_->Process();
|
rtp_rtcp_->Process();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool SendRTP(const uint8_t* packet, size_t length) OVERRIDE {
|
virtual bool SendRTP(const uint8_t* packet, size_t length) OVERRIDE {
|
||||||
CriticalSectionScoped lock(critical_section_.get());
|
CriticalSectionScoped lock(critical_section_.get());
|
||||||
RTPHeader header;
|
RTPHeader header;
|
||||||
EXPECT_TRUE(rtp_parser_->Parse(packet, static_cast<int>(length),
|
EXPECT_TRUE(rtp_parser_->Parse(packet, static_cast<int>(length), &header));
|
||||||
&header));
|
|
||||||
receive_stats_->IncomingPacket(header, length, false);
|
receive_stats_->IncomingPacket(header, length, false);
|
||||||
rtp_rtcp_->SetRemoteSSRC(header.ssrc);
|
rtp_rtcp_->SetRemoteSSRC(header.ssrc);
|
||||||
remote_bitrate_estimator_->IncomingPacket(clock_->TimeInMilliseconds(),
|
remote_bitrate_estimator_->IncomingPacket(
|
||||||
static_cast<int>(length - 12),
|
clock_->TimeInMilliseconds(), static_cast<int>(length - 12), header);
|
||||||
header);
|
|
||||||
if (remote_bitrate_estimator_->TimeUntilNextProcess() <= 0) {
|
if (remote_bitrate_estimator_->TimeUntilNextProcess() <= 0) {
|
||||||
remote_bitrate_estimator_->Process();
|
remote_bitrate_estimator_->Process();
|
||||||
}
|
}
|
||||||
@ -90,9 +89,7 @@ class StreamObserver : public newapi::Transport, public RemoteBitrateObserver {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
EventTypeWrapper Wait() {
|
EventTypeWrapper Wait() { return all_ssrcs_sent_->Wait(120 * 1000); }
|
||||||
return all_ssrcs_sent_->Wait(120 * 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class TransportWrapper : public webrtc::Transport {
|
class TransportWrapper : public webrtc::Transport {
|
||||||
@ -100,15 +97,18 @@ class StreamObserver : public newapi::Transport, public RemoteBitrateObserver {
|
|||||||
explicit TransportWrapper(newapi::Transport* new_transport)
|
explicit TransportWrapper(newapi::Transport* new_transport)
|
||||||
: new_transport_(new_transport) {}
|
: new_transport_(new_transport) {}
|
||||||
|
|
||||||
virtual int SendPacket(int channel, const void *data, int len) OVERRIDE {
|
virtual int SendPacket(int channel, const void* data, int len) OVERRIDE {
|
||||||
return new_transport_->SendRTP(static_cast<const uint8_t*>(data), len) ?
|
return new_transport_->SendRTP(static_cast<const uint8_t*>(data), len)
|
||||||
len : -1;
|
? len
|
||||||
|
: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int SendRTCPPacket(int channel, const void *data,
|
virtual int SendRTCPPacket(int channel,
|
||||||
|
const void* data,
|
||||||
int len) OVERRIDE {
|
int len) OVERRIDE {
|
||||||
return new_transport_->SendRTCP(static_cast<const uint8_t*>(data), len) ?
|
return new_transport_->SendRTCP(static_cast<const uint8_t*>(data), len)
|
||||||
len : -1;
|
? len
|
||||||
|
: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -130,9 +130,7 @@ class StreamObserver : public newapi::Transport, public RemoteBitrateObserver {
|
|||||||
|
|
||||||
class RampUpTest : public ::testing::TestWithParam<bool> {
|
class RampUpTest : public ::testing::TestWithParam<bool> {
|
||||||
public:
|
public:
|
||||||
virtual void SetUp() {
|
virtual void SetUp() { reserved_ssrcs_.clear(); }
|
||||||
reserved_ssrcs_.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::map<uint32_t, bool> reserved_ssrcs_;
|
std::map<uint32_t, bool> reserved_ssrcs_;
|
||||||
@ -140,12 +138,11 @@ class RampUpTest : public ::testing::TestWithParam<bool> {
|
|||||||
|
|
||||||
TEST_P(RampUpTest, RampUpWithPadding) {
|
TEST_P(RampUpTest, RampUpWithPadding) {
|
||||||
test::DirectTransport receiver_transport;
|
test::DirectTransport receiver_transport;
|
||||||
StreamObserver stream_observer(3, &receiver_transport,
|
StreamObserver stream_observer(
|
||||||
Clock::GetRealTimeClock());
|
3, &receiver_transport, Clock::GetRealTimeClock());
|
||||||
VideoCall::Config call_config(&stream_observer);
|
Call::Config call_config(&stream_observer);
|
||||||
scoped_ptr<VideoCall> call(VideoCall::Create(call_config));
|
scoped_ptr<Call> call(Call::Create(call_config));
|
||||||
VideoSendStream::Config send_config =
|
VideoSendStream::Config send_config = call->GetDefaultSendConfig();
|
||||||
call->GetDefaultSendConfig();
|
|
||||||
|
|
||||||
receiver_transport.SetReceiver(call->Receiver());
|
receiver_transport.SetReceiver(call->Receiver());
|
||||||
|
|
||||||
@ -157,22 +154,20 @@ TEST_P(RampUpTest, RampUpWithPadding) {
|
|||||||
|
|
||||||
test::GenerateRandomSsrcs(&send_config, &reserved_ssrcs_);
|
test::GenerateRandomSsrcs(&send_config, &reserved_ssrcs_);
|
||||||
|
|
||||||
VideoSendStream* send_stream =
|
VideoSendStream* send_stream = call->CreateSendStream(send_config);
|
||||||
call->CreateSendStream(send_config);
|
|
||||||
|
|
||||||
VideoReceiveStream::Config receive_config;
|
VideoReceiveStream::Config receive_config;
|
||||||
receive_config.rtp.ssrc = send_config.rtp.ssrcs[0];
|
receive_config.rtp.ssrc = send_config.rtp.ssrcs[0];
|
||||||
receive_config.rtp.nack.rtp_history_ms =
|
receive_config.rtp.nack.rtp_history_ms = send_config.rtp.nack.rtp_history_ms;
|
||||||
send_config.rtp.nack.rtp_history_ms;
|
VideoReceiveStream* receive_stream =
|
||||||
VideoReceiveStream* receive_stream = call->CreateReceiveStream(
|
call->CreateReceiveStream(receive_config);
|
||||||
receive_config);
|
|
||||||
|
|
||||||
scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer(
|
scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer(
|
||||||
test::FrameGeneratorCapturer::Create(
|
test::FrameGeneratorCapturer::Create(
|
||||||
send_stream->Input(),
|
send_stream->Input(),
|
||||||
test::FrameGenerator::Create(
|
test::FrameGenerator::Create(send_config.codec.width,
|
||||||
send_config.codec.width, send_config.codec.height,
|
send_config.codec.height,
|
||||||
Clock::GetRealTimeClock()),
|
Clock::GetRealTimeClock()),
|
||||||
30));
|
30));
|
||||||
|
|
||||||
receive_stream->StartReceive();
|
receive_stream->StartReceive();
|
||||||
@ -213,10 +208,10 @@ class EngineTest : public ::testing::TestWithParam<EngineTestParams> {
|
|||||||
protected:
|
protected:
|
||||||
void CreateCalls(newapi::Transport* sender_transport,
|
void CreateCalls(newapi::Transport* sender_transport,
|
||||||
newapi::Transport* receiver_transport) {
|
newapi::Transport* receiver_transport) {
|
||||||
VideoCall::Config sender_config(sender_transport);
|
Call::Config sender_config(sender_transport);
|
||||||
VideoCall::Config receiver_config(receiver_transport);
|
Call::Config receiver_config(receiver_transport);
|
||||||
sender_call_.reset(VideoCall::Create(sender_config));
|
sender_call_.reset(Call::Create(sender_config));
|
||||||
receiver_call_.reset(VideoCall::Create(receiver_config));
|
receiver_call_.reset(Call::Create(receiver_config));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateTestConfigs() {
|
void CreateTestConfigs() {
|
||||||
@ -273,14 +268,14 @@ class EngineTest : public ::testing::TestWithParam<EngineTestParams> {
|
|||||||
sender_call_->DestroySendStream(send_stream_);
|
sender_call_->DestroySendStream(send_stream_);
|
||||||
if (receive_stream_ != NULL)
|
if (receive_stream_ != NULL)
|
||||||
receiver_call_->DestroyReceiveStream(receive_stream_);
|
receiver_call_->DestroyReceiveStream(receive_stream_);
|
||||||
send_stream_= NULL;
|
send_stream_ = NULL;
|
||||||
receive_stream_ = NULL;
|
receive_stream_ = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReceivesPliAndRecovers(int rtp_history_ms);
|
void ReceivesPliAndRecovers(int rtp_history_ms);
|
||||||
|
|
||||||
scoped_ptr<VideoCall> sender_call_;
|
scoped_ptr<Call> sender_call_;
|
||||||
scoped_ptr<VideoCall> receiver_call_;
|
scoped_ptr<Call> receiver_call_;
|
||||||
|
|
||||||
VideoSendStream::Config send_config_;
|
VideoSendStream::Config send_config_;
|
||||||
VideoReceiveStream::Config receive_config_;
|
VideoReceiveStream::Config receive_config_;
|
||||||
@ -310,6 +305,7 @@ class NackObserver : public test::RtpRtcpObserver {
|
|||||||
static const int kNumberOfNacksToObserve = 4;
|
static const int kNumberOfNacksToObserve = 4;
|
||||||
static const int kInverseProbabilityToStartLossBurst = 20;
|
static const int kInverseProbabilityToStartLossBurst = 20;
|
||||||
static const int kMaxLossBurst = 10;
|
static const int kMaxLossBurst = 10;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NackObserver()
|
NackObserver()
|
||||||
: received_all_retransmissions_(EventWrapper::Create()),
|
: received_all_retransmissions_(EventWrapper::Create()),
|
||||||
@ -444,9 +440,10 @@ TEST_P(EngineTest, ReceivesAndRetransmitsNack) {
|
|||||||
|
|
||||||
class PliObserver : public test::RtpRtcpObserver {
|
class PliObserver : public test::RtpRtcpObserver {
|
||||||
static const int kInverseDropProbability = 16;
|
static const int kInverseDropProbability = 16;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PliObserver(bool nack_enabled) :
|
PliObserver(bool nack_enabled)
|
||||||
renderer_(this),
|
: renderer_(this),
|
||||||
rtp_header_parser_(RtpHeaderParser::Create()),
|
rtp_header_parser_(RtpHeaderParser::Create()),
|
||||||
nack_enabled_(nack_enabled),
|
nack_enabled_(nack_enabled),
|
||||||
first_retransmitted_timestamp_(0),
|
first_retransmitted_timestamp_(0),
|
||||||
@ -572,9 +569,7 @@ TEST_P(EngineTest, SurvivesIncomingRtpPacketsToDestroyedReceiveStream) {
|
|||||||
explicit PacketInputObserver(PacketReceiver* receiver)
|
explicit PacketInputObserver(PacketReceiver* receiver)
|
||||||
: receiver_(receiver), delivered_packet_(EventWrapper::Create()) {}
|
: receiver_(receiver), delivered_packet_(EventWrapper::Create()) {}
|
||||||
|
|
||||||
EventTypeWrapper Wait() {
|
EventTypeWrapper Wait() { return delivered_packet_->Wait(30 * 1000); }
|
||||||
return delivered_packet_->Wait(30 * 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual bool DeliverPacket(const uint8_t* packet, size_t length) {
|
virtual bool DeliverPacket(const uint8_t* packet, size_t length) {
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
||||||
#include "webrtc/test/testsupport/fileutils.h"
|
#include "webrtc/test/testsupport/fileutils.h"
|
||||||
#include "webrtc/typedefs.h"
|
#include "webrtc/typedefs.h"
|
||||||
#include "webrtc/video_engine/new_include/video_call.h"
|
#include "webrtc/video_engine/new_include/call.h"
|
||||||
#include "webrtc/video_engine/test/common/direct_transport.h"
|
#include "webrtc/video_engine/test/common/direct_transport.h"
|
||||||
#include "webrtc/video_engine/test/common/file_capturer.h"
|
#include "webrtc/video_engine/test/common/file_capturer.h"
|
||||||
#include "webrtc/video_engine/test/common/frame_generator_capturer.h"
|
#include "webrtc/video_engine/test/common/frame_generator_capturer.h"
|
||||||
@ -47,14 +47,16 @@ struct FullStackTestParams {
|
|||||||
double avg_ssim_threshold;
|
double avg_ssim_threshold;
|
||||||
};
|
};
|
||||||
|
|
||||||
FullStackTestParams paris_qcif = {"net_delay_0_0_plr_0",
|
FullStackTestParams paris_qcif = {
|
||||||
{"paris_qcif", 176, 144, 30}, 300, 36.0,
|
"net_delay_0_0_plr_0", {"paris_qcif", 176, 144, 30}, 300, 36.0, 0.96};
|
||||||
0.96};
|
|
||||||
|
|
||||||
// TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
|
// TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif.
|
||||||
FullStackTestParams foreman_cif = {"foreman_cif_net_delay_0_0_plr_0",
|
FullStackTestParams foreman_cif = {
|
||||||
{"foreman_cif", 352, 288, 30}, 700, 0.0,
|
"foreman_cif_net_delay_0_0_plr_0",
|
||||||
0.0};
|
{"foreman_cif", 352, 288, 30},
|
||||||
|
700,
|
||||||
|
0.0,
|
||||||
|
0.0};
|
||||||
|
|
||||||
class FullStackTest : public ::testing::TestWithParam<FullStackTestParams> {
|
class FullStackTest : public ::testing::TestWithParam<FullStackTestParams> {
|
||||||
protected:
|
protected:
|
||||||
@ -280,9 +282,9 @@ TEST_P(FullStackTest, DISABLED_NoPacketLoss) {
|
|||||||
params.avg_ssim_threshold,
|
params.avg_ssim_threshold,
|
||||||
static_cast<uint64_t>(FLAGS_seconds * params.clip.fps));
|
static_cast<uint64_t>(FLAGS_seconds * params.clip.fps));
|
||||||
|
|
||||||
VideoCall::Config call_config(&analyzer);
|
Call::Config call_config(&analyzer);
|
||||||
|
|
||||||
scoped_ptr<VideoCall> call(VideoCall::Create(call_config));
|
scoped_ptr<Call> call(Call::Create(call_config));
|
||||||
analyzer.receiver_ = call->Receiver();
|
analyzer.receiver_ = call->Receiver();
|
||||||
transport.SetReceiver(&analyzer);
|
transport.SetReceiver(&analyzer);
|
||||||
|
|
||||||
@ -314,8 +316,7 @@ TEST_P(FullStackTest, DISABLED_NoPacketLoss) {
|
|||||||
test_clock),
|
test_clock),
|
||||||
params.clip.fps));
|
params.clip.fps));
|
||||||
|
|
||||||
VideoReceiveStream::Config receive_config =
|
VideoReceiveStream::Config receive_config = call->GetDefaultReceiveConfig();
|
||||||
call->GetDefaultReceiveConfig();
|
|
||||||
receive_config.rtp.ssrc = send_config.rtp.ssrcs[0];
|
receive_config.rtp.ssrc = send_config.rtp.ssrcs[0];
|
||||||
receive_config.renderer = &analyzer;
|
receive_config.renderer = &analyzer;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "webrtc/system_wrappers/interface/clock.h"
|
#include "webrtc/system_wrappers/interface/clock.h"
|
||||||
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
||||||
#include "webrtc/typedefs.h"
|
#include "webrtc/typedefs.h"
|
||||||
#include "webrtc/video_engine/new_include/video_call.h"
|
#include "webrtc/video_engine/new_include/call.h"
|
||||||
#include "webrtc/video_engine/test/common/direct_transport.h"
|
#include "webrtc/video_engine/test/common/direct_transport.h"
|
||||||
#include "webrtc/video_engine/test/common/flags.h"
|
#include "webrtc/video_engine/test/common/flags.h"
|
||||||
#include "webrtc/video_engine/test/common/generate_ssrcs.h"
|
#include "webrtc/video_engine/test/common/generate_ssrcs.h"
|
||||||
@ -40,9 +40,9 @@ TEST_F(LoopbackTest, Test) {
|
|||||||
"Loopback Video", test::flags::Width(), test::flags::Height()));
|
"Loopback Video", test::flags::Width(), test::flags::Height()));
|
||||||
|
|
||||||
test::DirectTransport transport;
|
test::DirectTransport transport;
|
||||||
VideoCall::Config call_config(&transport);
|
Call::Config call_config(&transport);
|
||||||
call_config.overuse_detection = true;
|
call_config.overuse_detection = true;
|
||||||
scoped_ptr<VideoCall> call(VideoCall::Create(call_config));
|
scoped_ptr<Call> call(Call::Create(call_config));
|
||||||
|
|
||||||
// Loopback, call sends to itself.
|
// Loopback, call sends to itself.
|
||||||
transport.SetReceiver(call->Receiver());
|
transport.SetReceiver(call->Receiver());
|
||||||
@ -74,8 +74,7 @@ TEST_F(LoopbackTest, Test) {
|
|||||||
test::flags::Fps(),
|
test::flags::Fps(),
|
||||||
test_clock));
|
test_clock));
|
||||||
|
|
||||||
VideoReceiveStream::Config receive_config =
|
VideoReceiveStream::Config receive_config = call->GetDefaultReceiveConfig();
|
||||||
call->GetDefaultReceiveConfig();
|
|
||||||
receive_config.rtp.ssrc = send_config.rtp.ssrcs[0];
|
receive_config.rtp.ssrc = send_config.rtp.ssrcs[0];
|
||||||
receive_config.renderer = loopback_video.get();
|
receive_config.renderer = loopback_video.get();
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "webrtc/video_engine/test/common/frame_generator.h"
|
#include "webrtc/video_engine/test/common/frame_generator.h"
|
||||||
#include "webrtc/video_engine/test/common/frame_generator_capturer.h"
|
#include "webrtc/video_engine/test/common/frame_generator_capturer.h"
|
||||||
#include "webrtc/video_engine/test/common/null_transport.h"
|
#include "webrtc/video_engine/test/common/null_transport.h"
|
||||||
#include "webrtc/video_engine/new_include/video_call.h"
|
#include "webrtc/video_engine/new_include/call.h"
|
||||||
#include "webrtc/video_engine/new_include/video_send_stream.h"
|
#include "webrtc/video_engine/new_include/video_send_stream.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
@ -28,9 +28,7 @@ class SendTransportObserver : public test::NullTransport {
|
|||||||
send_test_complete_(EventWrapper::Create()),
|
send_test_complete_(EventWrapper::Create()),
|
||||||
timeout_ms_(timeout_ms) {}
|
timeout_ms_(timeout_ms) {}
|
||||||
|
|
||||||
EventTypeWrapper Wait() {
|
EventTypeWrapper Wait() { return send_test_complete_->Wait(timeout_ms_); }
|
||||||
return send_test_complete_->Wait(timeout_ms_);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
scoped_ptr<RtpHeaderParser> rtp_header_parser_;
|
scoped_ptr<RtpHeaderParser> rtp_header_parser_;
|
||||||
@ -43,9 +41,10 @@ class SendTransportObserver : public test::NullTransport {
|
|||||||
class VideoSendStreamTest : public ::testing::Test {
|
class VideoSendStreamTest : public ::testing::Test {
|
||||||
public:
|
public:
|
||||||
VideoSendStreamTest() : fake_encoder_(Clock::GetRealTimeClock()) {}
|
VideoSendStreamTest() : fake_encoder_(Clock::GetRealTimeClock()) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static const uint32_t kSendSsrc;
|
static const uint32_t kSendSsrc;
|
||||||
void RunSendTest(VideoCall* call,
|
void RunSendTest(Call* call,
|
||||||
const VideoSendStream::Config& config,
|
const VideoSendStream::Config& config,
|
||||||
SendTransportObserver* observer) {
|
SendTransportObserver* observer) {
|
||||||
VideoSendStream* send_stream = call->CreateSendStream(config);
|
VideoSendStream* send_stream = call->CreateSendStream(config);
|
||||||
@ -64,7 +63,7 @@ class VideoSendStreamTest : public ::testing::Test {
|
|||||||
call->DestroySendStream(send_stream);
|
call->DestroySendStream(send_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoSendStream::Config GetSendTestConfig(VideoCall* call) {
|
VideoSendStream::Config GetSendTestConfig(Call* call) {
|
||||||
VideoSendStream::Config config = call->GetDefaultSendConfig();
|
VideoSendStream::Config config = call->GetDefaultSendConfig();
|
||||||
config.encoder = &fake_encoder_;
|
config.encoder = &fake_encoder_;
|
||||||
config.internal_source = false;
|
config.internal_source = false;
|
||||||
@ -94,8 +93,8 @@ TEST_F(VideoSendStreamTest, SendsSetSsrc) {
|
|||||||
}
|
}
|
||||||
} observer;
|
} observer;
|
||||||
|
|
||||||
VideoCall::Config call_config(&observer);
|
Call::Config call_config(&observer);
|
||||||
scoped_ptr<VideoCall> call(VideoCall::Create(call_config));
|
scoped_ptr<Call> call(Call::Create(call_config));
|
||||||
|
|
||||||
VideoSendStream::Config send_config = GetSendTestConfig(call.get());
|
VideoSendStream::Config send_config = GetSendTestConfig(call.get());
|
||||||
send_config.rtp.ssrcs.push_back(kSendSsrc);
|
send_config.rtp.ssrcs.push_back(kSendSsrc);
|
||||||
@ -127,8 +126,8 @@ TEST_F(VideoSendStreamTest, SupportsCName) {
|
|||||||
}
|
}
|
||||||
} observer;
|
} observer;
|
||||||
|
|
||||||
VideoCall::Config call_config(&observer);
|
Call::Config call_config(&observer);
|
||||||
scoped_ptr<VideoCall> call(VideoCall::Create(call_config));
|
scoped_ptr<Call> call(Call::Create(call_config));
|
||||||
|
|
||||||
VideoSendStream::Config send_config = GetSendTestConfig(call.get());
|
VideoSendStream::Config send_config = GetSendTestConfig(call.get());
|
||||||
send_config.rtp.ssrcs.push_back(kSendSsrc);
|
send_config.rtp.ssrcs.push_back(kSendSsrc);
|
||||||
|
@ -115,16 +115,16 @@
|
|||||||
'vie_sync_module.cc',
|
'vie_sync_module.cc',
|
||||||
|
|
||||||
# New VideoEngine API
|
# New VideoEngine API
|
||||||
'internal/video_call.cc',
|
'internal/call.cc',
|
||||||
'internal/video_call.h',
|
'internal/call.h',
|
||||||
'internal/video_receive_stream.cc',
|
'internal/video_receive_stream.cc',
|
||||||
'internal/video_receive_stream.h',
|
'internal/video_receive_stream.h',
|
||||||
'internal/video_send_stream.cc',
|
'internal/video_send_stream.cc',
|
||||||
'internal/video_send_stream.h',
|
'internal/video_send_stream.h',
|
||||||
|
'new_include/call.h',
|
||||||
'new_include/config.h',
|
'new_include/config.h',
|
||||||
'new_include/frame_callback.h',
|
'new_include/frame_callback.h',
|
||||||
'new_include/transport.h',
|
'new_include/transport.h',
|
||||||
'new_include/video_call.h',
|
|
||||||
'new_include/video_receive_stream.h',
|
'new_include/video_receive_stream.h',
|
||||||
'new_include/video_renderer.h',
|
'new_include/video_renderer.h',
|
||||||
'new_include/video_send_stream.h',
|
'new_include/video_send_stream.h',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user