Remove newapi:: namespace for typenames without overlap.
Typing newapi:: everywhere is very verbose, and doesn't add any real value. The new API is still separated from other code by being in separate directories, such as internal/ or new_include. BUG= R=stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/2075004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4601 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
ceea41d135
commit
74fa4893f9
@ -24,19 +24,17 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
namespace newapi {
|
VideoCall* VideoCall::Create(const VideoCall::Config& config) {
|
||||||
VideoCall* VideoCall::Create(const newapi::VideoCall::Config& config) {
|
|
||||||
webrtc::VideoEngine* video_engine = webrtc::VideoEngine::Create();
|
webrtc::VideoEngine* video_engine = webrtc::VideoEngine::Create();
|
||||||
assert(video_engine != NULL);
|
assert(video_engine != NULL);
|
||||||
|
|
||||||
return new internal::VideoCall(video_engine, config);
|
return new internal::VideoCall(video_engine, config);
|
||||||
}
|
}
|
||||||
} // namespace newapi
|
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
VideoCall::VideoCall(webrtc::VideoEngine* video_engine,
|
VideoCall::VideoCall(webrtc::VideoEngine* video_engine,
|
||||||
const newapi::VideoCall::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()),
|
||||||
@ -58,7 +56,7 @@ VideoCall::~VideoCall() {
|
|||||||
webrtc::VideoEngine::Delete(video_engine_);
|
webrtc::VideoEngine::Delete(video_engine_);
|
||||||
}
|
}
|
||||||
|
|
||||||
newapi::PacketReceiver* VideoCall::Receiver() { return this; }
|
PacketReceiver* VideoCall::Receiver() { return this; }
|
||||||
|
|
||||||
std::vector<VideoCodec> VideoCall::GetVideoCodecs() {
|
std::vector<VideoCodec> VideoCall::GetVideoCodecs() {
|
||||||
std::vector<VideoCodec> codecs;
|
std::vector<VideoCodec> codecs;
|
||||||
@ -78,8 +76,8 @@ VideoSendStream::Config VideoCall::GetDefaultSendConfig() {
|
|||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
newapi::VideoSendStream* VideoCall::CreateSendStream(
|
VideoSendStream* VideoCall::CreateSendStream(
|
||||||
const newapi::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());
|
||||||
@ -95,8 +93,8 @@ newapi::VideoSendStream* VideoCall::CreateSendStream(
|
|||||||
return send_stream;
|
return send_stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
newapi::SendStreamState* VideoCall::DestroySendStream(
|
SendStreamState* VideoCall::DestroySendStream(
|
||||||
newapi::VideoSendStream* send_stream) {
|
webrtc::VideoSendStream* send_stream) {
|
||||||
if (send_stream == NULL) {
|
if (send_stream == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -108,11 +106,11 @@ newapi::SendStreamState* VideoCall::DestroySendStream(
|
|||||||
}
|
}
|
||||||
|
|
||||||
VideoReceiveStream::Config VideoCall::GetDefaultReceiveConfig() {
|
VideoReceiveStream::Config VideoCall::GetDefaultReceiveConfig() {
|
||||||
return newapi::VideoReceiveStream::Config();
|
return VideoReceiveStream::Config();
|
||||||
}
|
}
|
||||||
|
|
||||||
newapi::VideoReceiveStream* VideoCall::CreateReceiveStream(
|
VideoReceiveStream* VideoCall::CreateReceiveStream(
|
||||||
const newapi::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);
|
||||||
|
|
||||||
@ -123,7 +121,7 @@ newapi::VideoReceiveStream* VideoCall::CreateReceiveStream(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void VideoCall::DestroyReceiveStream(
|
void VideoCall::DestroyReceiveStream(
|
||||||
newapi::VideoReceiveStream* receive_stream) {
|
webrtc::VideoReceiveStream* receive_stream) {
|
||||||
if (receive_stream == NULL) {
|
if (receive_stream == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -30,29 +30,29 @@ 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 newapi::VideoCall, public newapi::PacketReceiver {
|
class VideoCall : public webrtc::VideoCall, public PacketReceiver {
|
||||||
public:
|
public:
|
||||||
VideoCall(webrtc::VideoEngine* video_engine,
|
VideoCall(webrtc::VideoEngine* video_engine,
|
||||||
const newapi::VideoCall::Config& config);
|
const VideoCall::Config& config);
|
||||||
virtual ~VideoCall();
|
virtual ~VideoCall();
|
||||||
|
|
||||||
virtual newapi::PacketReceiver* Receiver() OVERRIDE;
|
virtual PacketReceiver* Receiver() OVERRIDE;
|
||||||
virtual std::vector<VideoCodec> GetVideoCodecs() OVERRIDE;
|
virtual std::vector<VideoCodec> GetVideoCodecs() OVERRIDE;
|
||||||
|
|
||||||
virtual newapi::VideoSendStream::Config GetDefaultSendConfig() OVERRIDE;
|
virtual VideoSendStream::Config GetDefaultSendConfig() OVERRIDE;
|
||||||
|
|
||||||
virtual newapi::VideoSendStream* CreateSendStream(
|
virtual VideoSendStream* CreateSendStream(
|
||||||
const newapi::VideoSendStream::Config& config) OVERRIDE;
|
const VideoSendStream::Config& config) OVERRIDE;
|
||||||
|
|
||||||
virtual newapi::SendStreamState* DestroySendStream(
|
virtual SendStreamState* DestroySendStream(
|
||||||
newapi::VideoSendStream* send_stream) OVERRIDE;
|
webrtc::VideoSendStream* send_stream) OVERRIDE;
|
||||||
|
|
||||||
virtual newapi::VideoReceiveStream::Config GetDefaultReceiveConfig() OVERRIDE;
|
virtual VideoReceiveStream::Config GetDefaultReceiveConfig() OVERRIDE;
|
||||||
|
|
||||||
virtual newapi::VideoReceiveStream* CreateReceiveStream(
|
virtual VideoReceiveStream* CreateReceiveStream(
|
||||||
const newapi::VideoReceiveStream::Config& config) OVERRIDE;
|
const VideoReceiveStream::Config& config) OVERRIDE;
|
||||||
|
|
||||||
virtual void DestroyReceiveStream(newapi::VideoReceiveStream* receive_stream)
|
virtual void DestroyReceiveStream(webrtc::VideoReceiveStream* receive_stream)
|
||||||
OVERRIDE;
|
OVERRIDE;
|
||||||
|
|
||||||
virtual uint32_t SendBitrateEstimate() OVERRIDE;
|
virtual uint32_t SendBitrateEstimate() OVERRIDE;
|
||||||
@ -66,7 +66,7 @@ class VideoCall : public newapi::VideoCall, public newapi::PacketReceiver {
|
|||||||
const uint8_t* packet,
|
const uint8_t* packet,
|
||||||
size_t length);
|
size_t length);
|
||||||
|
|
||||||
newapi::VideoCall::Config config_;
|
VideoCall::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_;
|
||||||
|
@ -28,7 +28,7 @@ namespace internal {
|
|||||||
|
|
||||||
VideoReceiveStream::VideoReceiveStream(
|
VideoReceiveStream::VideoReceiveStream(
|
||||||
webrtc::VideoEngine* video_engine,
|
webrtc::VideoEngine* video_engine,
|
||||||
const newapi::VideoReceiveStream::Config& config,
|
const VideoReceiveStream::Config& config,
|
||||||
newapi::Transport* transport)
|
newapi::Transport* transport)
|
||||||
: transport_(transport), config_(config), channel_(-1) {
|
: transport_(transport), config_(config), channel_(-1) {
|
||||||
video_engine_base_ = ViEBase::GetInterface(video_engine);
|
video_engine_base_ = ViEBase::GetInterface(video_engine);
|
||||||
|
@ -29,12 +29,12 @@ class ViERTP_RTCP;
|
|||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
class VideoReceiveStream : public newapi::VideoReceiveStream,
|
class VideoReceiveStream : public webrtc::VideoReceiveStream,
|
||||||
public webrtc::ExternalRenderer,
|
public webrtc::ExternalRenderer,
|
||||||
public webrtc::Transport {
|
public webrtc::Transport {
|
||||||
public:
|
public:
|
||||||
VideoReceiveStream(webrtc::VideoEngine* video_engine,
|
VideoReceiveStream(webrtc::VideoEngine* video_engine,
|
||||||
const newapi::VideoReceiveStream::Config& config,
|
const VideoReceiveStream::Config& config,
|
||||||
newapi::Transport* transport);
|
newapi::Transport* transport);
|
||||||
virtual ~VideoReceiveStream();
|
virtual ~VideoReceiveStream();
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ class VideoReceiveStream : public newapi::VideoReceiveStream,
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
newapi::Transport* transport_;
|
newapi::Transport* transport_;
|
||||||
newapi::VideoReceiveStream::Config config_;
|
VideoReceiveStream::Config config_;
|
||||||
Clock* clock_;
|
Clock* clock_;
|
||||||
|
|
||||||
ViEBase* video_engine_base_;
|
ViEBase* video_engine_base_;
|
||||||
|
@ -79,7 +79,7 @@ class ResolutionAdaptor : public webrtc::CpuOveruseObserver {
|
|||||||
VideoSendStream::VideoSendStream(newapi::Transport* transport,
|
VideoSendStream::VideoSendStream(newapi::Transport* transport,
|
||||||
bool overuse_detection,
|
bool overuse_detection,
|
||||||
webrtc::VideoEngine* video_engine,
|
webrtc::VideoEngine* video_engine,
|
||||||
const newapi::VideoSendStream::Config& config)
|
const VideoSendStream::Config& config)
|
||||||
: transport_(transport), config_(config), external_codec_(NULL) {
|
: transport_(transport), config_(config), external_codec_(NULL) {
|
||||||
|
|
||||||
if (config_.codec.numberOfSimulcastStreams > 0) {
|
if (config_.codec.numberOfSimulcastStreams > 0) {
|
||||||
@ -198,7 +198,7 @@ void VideoSendStream::PutFrame(const I420VideoFrame& frame,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
newapi::VideoSendStreamInput* VideoSendStream::Input() { return this; }
|
VideoSendStreamInput* VideoSendStream::Input() { return this; }
|
||||||
|
|
||||||
void VideoSendStream::StartSend() {
|
void VideoSendStream::StartSend() {
|
||||||
if (video_engine_base_->StartSend(channel_) != 0)
|
if (video_engine_base_->StartSend(channel_) != 0)
|
||||||
|
@ -32,21 +32,21 @@ namespace internal {
|
|||||||
|
|
||||||
class ResolutionAdaptor;
|
class ResolutionAdaptor;
|
||||||
|
|
||||||
class VideoSendStream : public newapi::VideoSendStream,
|
class VideoSendStream : public webrtc::VideoSendStream,
|
||||||
public newapi::VideoSendStreamInput,
|
public VideoSendStreamInput,
|
||||||
public webrtc::Transport {
|
public webrtc::Transport {
|
||||||
public:
|
public:
|
||||||
VideoSendStream(newapi::Transport* transport,
|
VideoSendStream(newapi::Transport* transport,
|
||||||
bool overuse_detection,
|
bool overuse_detection,
|
||||||
webrtc::VideoEngine* video_engine,
|
webrtc::VideoEngine* video_engine,
|
||||||
const newapi::VideoSendStream::Config& config);
|
const VideoSendStream::Config& config);
|
||||||
|
|
||||||
virtual ~VideoSendStream();
|
virtual ~VideoSendStream();
|
||||||
|
|
||||||
virtual void PutFrame(const I420VideoFrame& frame,
|
virtual void PutFrame(const I420VideoFrame& frame,
|
||||||
uint32_t time_since_capture_ms) OVERRIDE;
|
uint32_t time_since_capture_ms) OVERRIDE;
|
||||||
|
|
||||||
virtual newapi::VideoSendStreamInput* Input() OVERRIDE;
|
virtual VideoSendStreamInput* Input() OVERRIDE;
|
||||||
|
|
||||||
virtual void StartSend() OVERRIDE;
|
virtual void StartSend() OVERRIDE;
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ class VideoSendStream : public newapi::VideoSendStream,
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
newapi::Transport* transport_;
|
newapi::Transport* transport_;
|
||||||
newapi::VideoSendStream::Config config_;
|
VideoSendStream::Config config_;
|
||||||
|
|
||||||
ViEBase* video_engine_base_;
|
ViEBase* video_engine_base_;
|
||||||
ViECapture* capture_;
|
ViECapture* capture_;
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace newapi {
|
|
||||||
|
|
||||||
struct RtpStatistics {
|
struct RtpStatistics {
|
||||||
RtpStatistics()
|
RtpStatistics()
|
||||||
@ -29,12 +28,14 @@ struct RtpStatistics {
|
|||||||
std::string c_name;
|
std::string c_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace newapi {
|
||||||
// RTCP mode to use. Compound mode is described by RFC 4585 and reduced-size
|
// RTCP mode to use. Compound mode is described by RFC 4585 and reduced-size
|
||||||
// RTCP mode is described by RFC 5506.
|
// RTCP mode is described by RFC 5506.
|
||||||
enum RtcpMode {
|
enum RtcpMode {
|
||||||
kRtcpCompound,
|
kRtcpCompound,
|
||||||
kRtcpReducedSize
|
kRtcpReducedSize
|
||||||
};
|
};
|
||||||
|
} // namespace newapi
|
||||||
|
|
||||||
// Settings for NACK, see RFC 4585 for details.
|
// Settings for NACK, see RFC 4585 for details.
|
||||||
struct NackConfig {
|
struct NackConfig {
|
||||||
@ -77,7 +78,6 @@ struct RtpExtension {
|
|||||||
std::string name;
|
std::string name;
|
||||||
int id;
|
int id;
|
||||||
};
|
};
|
||||||
} // namespace newapi
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_
|
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_
|
||||||
|
@ -15,8 +15,6 @@ namespace webrtc {
|
|||||||
|
|
||||||
class I420VideoFrame;
|
class I420VideoFrame;
|
||||||
|
|
||||||
namespace newapi {
|
|
||||||
|
|
||||||
struct EncodedFrame;
|
struct EncodedFrame;
|
||||||
|
|
||||||
class I420FrameCallback {
|
class I420FrameCallback {
|
||||||
@ -36,7 +34,6 @@ class EncodedFrameObserver {
|
|||||||
protected:
|
protected:
|
||||||
virtual ~EncodedFrameObserver() {}
|
virtual ~EncodedFrameObserver() {}
|
||||||
};
|
};
|
||||||
} // namespace newapi
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_FRAME_CALLBACK_H_
|
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_FRAME_CALLBACK_H_
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include "webrtc/video_engine/new_include/video_send_stream.h"
|
#include "webrtc/video_engine/new_include/video_send_stream.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace newapi {
|
|
||||||
|
|
||||||
class VoiceEngine;
|
class VoiceEngine;
|
||||||
|
|
||||||
@ -38,14 +37,14 @@ class PacketReceiver {
|
|||||||
class VideoCall {
|
class VideoCall {
|
||||||
public:
|
public:
|
||||||
struct Config {
|
struct Config {
|
||||||
explicit Config(Transport* send_transport)
|
explicit Config(newapi::Transport* send_transport)
|
||||||
: send_transport(send_transport),
|
: send_transport(send_transport),
|
||||||
overuse_detection(false),
|
overuse_detection(false),
|
||||||
voice_engine(NULL),
|
voice_engine(NULL),
|
||||||
trace_callback(NULL),
|
trace_callback(NULL),
|
||||||
trace_filter(kTraceNone) {}
|
trace_filter(kTraceNone) {}
|
||||||
|
|
||||||
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 VideoCall.
|
||||||
@ -90,7 +89,6 @@ class VideoCall {
|
|||||||
|
|
||||||
virtual ~VideoCall() {}
|
virtual ~VideoCall() {}
|
||||||
};
|
};
|
||||||
} // namespace newapi
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_CALL_H_
|
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_CALL_H_
|
||||||
|
@ -24,8 +24,6 @@ namespace webrtc {
|
|||||||
|
|
||||||
class VideoDecoder;
|
class VideoDecoder;
|
||||||
|
|
||||||
namespace newapi {
|
|
||||||
|
|
||||||
// TODO(mflodman) Move all these settings to VideoDecoder and move the
|
// TODO(mflodman) Move all these settings to VideoDecoder and move the
|
||||||
// declaration to common_types.h.
|
// declaration to common_types.h.
|
||||||
struct ExternalVideoDecoder {
|
struct ExternalVideoDecoder {
|
||||||
@ -163,7 +161,6 @@ class VideoReceiveStream {
|
|||||||
virtual ~VideoReceiveStream() {}
|
virtual ~VideoReceiveStream() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace newapi
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_RECEIVE_STREAM_H_
|
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_RECEIVE_STREAM_H_
|
||||||
|
@ -15,8 +15,6 @@ namespace webrtc {
|
|||||||
|
|
||||||
class I420VideoFrame;
|
class I420VideoFrame;
|
||||||
|
|
||||||
namespace newapi {
|
|
||||||
|
|
||||||
class VideoRenderer {
|
class VideoRenderer {
|
||||||
public:
|
public:
|
||||||
// This function should return as soon as possible and not block until it's
|
// This function should return as soon as possible and not block until it's
|
||||||
@ -28,7 +26,6 @@ class VideoRenderer {
|
|||||||
protected:
|
protected:
|
||||||
virtual ~VideoRenderer() {}
|
virtual ~VideoRenderer() {}
|
||||||
};
|
};
|
||||||
} // namespace newapi
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_RENDERER_H_
|
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_RENDERER_H_
|
||||||
|
@ -23,8 +23,6 @@ namespace webrtc {
|
|||||||
|
|
||||||
class VideoEncoder;
|
class VideoEncoder;
|
||||||
|
|
||||||
namespace newapi {
|
|
||||||
|
|
||||||
struct SendStreamState;
|
struct SendStreamState;
|
||||||
|
|
||||||
// Class to deliver captured frame to the video send stream.
|
// Class to deliver captured frame to the video send stream.
|
||||||
@ -87,8 +85,8 @@ class VideoSendStream {
|
|||||||
VideoCodec codec;
|
VideoCodec codec;
|
||||||
|
|
||||||
struct Rtp {
|
struct Rtp {
|
||||||
Rtp() : mode(kRtcpReducedSize), max_packet_size(0) {}
|
Rtp() : mode(newapi::kRtcpReducedSize), max_packet_size(0) {}
|
||||||
RtcpMode mode;
|
newapi::RtcpMode mode;
|
||||||
|
|
||||||
std::vector<uint32_t> ssrcs;
|
std::vector<uint32_t> ssrcs;
|
||||||
|
|
||||||
@ -168,7 +166,6 @@ class VideoSendStream {
|
|||||||
virtual ~VideoSendStream() {}
|
virtual ~VideoSendStream() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace newapi
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
||||||
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_SEND_STREAM_H_
|
#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_VIDEO_SEND_STREAM_H_
|
||||||
|
@ -37,7 +37,7 @@ void DirectTransport::StopSending() {
|
|||||||
EXPECT_TRUE(thread_->Stop());
|
EXPECT_TRUE(thread_->Stop());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DirectTransport::SetReceiver(newapi::PacketReceiver* receiver) {
|
void DirectTransport::SetReceiver(PacketReceiver* receiver) {
|
||||||
receiver_ = receiver;
|
receiver_ = receiver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,9 +22,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
namespace newapi {
|
|
||||||
class PacketReceiver;
|
class PacketReceiver;
|
||||||
} // namespace newapi
|
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
@ -34,7 +32,7 @@ class DirectTransport : public newapi::Transport {
|
|||||||
~DirectTransport();
|
~DirectTransport();
|
||||||
|
|
||||||
virtual void StopSending();
|
virtual void StopSending();
|
||||||
virtual void SetReceiver(newapi::PacketReceiver* receiver);
|
virtual void SetReceiver(PacketReceiver* receiver);
|
||||||
|
|
||||||
virtual bool SendRTP(const uint8_t* data, size_t length) OVERRIDE;
|
virtual bool SendRTP(const uint8_t* data, size_t length) OVERRIDE;
|
||||||
virtual bool SendRTCP(const uint8_t* data, size_t length) OVERRIDE;
|
virtual bool SendRTCP(const uint8_t* data, size_t length) OVERRIDE;
|
||||||
@ -60,7 +58,7 @@ class DirectTransport : public newapi::Transport {
|
|||||||
bool shutting_down_;
|
bool shutting_down_;
|
||||||
|
|
||||||
std::deque<Packet> packet_queue_;
|
std::deque<Packet> packet_queue_;
|
||||||
newapi::PacketReceiver* receiver_;
|
PacketReceiver* receiver_;
|
||||||
};
|
};
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
@ -20,9 +20,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
class Clock;
|
class Clock;
|
||||||
|
|
||||||
namespace newapi {
|
|
||||||
class VideoSendStreamInput;
|
class VideoSendStreamInput;
|
||||||
} // namespace newapi
|
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ FrameGenerator* FrameGenerator::Create(size_t width,
|
|||||||
return new ChromaFrameGenerator(width, height, clock);
|
return new ChromaFrameGenerator(width, height, clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FrameGenerator::InsertFrame(newapi::VideoSendStreamInput* input) {
|
void FrameGenerator::InsertFrame(VideoSendStreamInput* input) {
|
||||||
int64_t time_before = clock_->CurrentNtpInMilliseconds();
|
int64_t time_before = clock_->CurrentNtpInMilliseconds();
|
||||||
frame_.set_render_time_ms(time_before);
|
frame_.set_render_time_ms(time_before);
|
||||||
|
|
||||||
|
@ -17,9 +17,7 @@ namespace webrtc {
|
|||||||
|
|
||||||
class Clock;
|
class Clock;
|
||||||
|
|
||||||
namespace newapi {
|
|
||||||
class VideoSendStreamInput;
|
class VideoSendStreamInput;
|
||||||
} // newapi
|
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
@ -30,7 +28,7 @@ class FrameGenerator {
|
|||||||
static FrameGenerator* Create(size_t width, size_t height, Clock* clock);
|
static FrameGenerator* Create(size_t width, size_t height, Clock* clock);
|
||||||
virtual ~FrameGenerator() {}
|
virtual ~FrameGenerator() {}
|
||||||
|
|
||||||
void InsertFrame(newapi::VideoSendStreamInput* input);
|
void InsertFrame(VideoSendStreamInput* input);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
FrameGenerator(size_t width, size_t height, Clock* clock);
|
FrameGenerator(size_t width, size_t height, Clock* clock);
|
||||||
|
@ -20,7 +20,7 @@ namespace webrtc {
|
|||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
FrameGeneratorCapturer* FrameGeneratorCapturer::Create(
|
FrameGeneratorCapturer* FrameGeneratorCapturer::Create(
|
||||||
newapi::VideoSendStreamInput* input,
|
VideoSendStreamInput* input,
|
||||||
FrameGenerator* frame_generator,
|
FrameGenerator* frame_generator,
|
||||||
int target_fps) {
|
int target_fps) {
|
||||||
FrameGeneratorCapturer* capturer =
|
FrameGeneratorCapturer* capturer =
|
||||||
@ -35,7 +35,7 @@ FrameGeneratorCapturer* FrameGeneratorCapturer::Create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
FrameGeneratorCapturer::FrameGeneratorCapturer(
|
FrameGeneratorCapturer::FrameGeneratorCapturer(
|
||||||
newapi::VideoSendStreamInput* input,
|
VideoSendStreamInput* input,
|
||||||
FrameGenerator* frame_generator,
|
FrameGenerator* frame_generator,
|
||||||
int target_fps)
|
int target_fps)
|
||||||
: VideoCapturer(input),
|
: VideoCapturer(input),
|
||||||
|
@ -28,7 +28,7 @@ class FrameGeneratorCapturer : public VideoCapturer {
|
|||||||
public:
|
public:
|
||||||
// The FrameGeneratorCapturer takes ownership of the FrameGenerator, which
|
// The FrameGeneratorCapturer takes ownership of the FrameGenerator, which
|
||||||
// will be freed when the FrameGeneratorCapturer is deleted.
|
// will be freed when the FrameGeneratorCapturer is deleted.
|
||||||
static FrameGeneratorCapturer* Create(newapi::VideoSendStreamInput* input,
|
static FrameGeneratorCapturer* Create(VideoSendStreamInput* input,
|
||||||
FrameGenerator* frame_generator,
|
FrameGenerator* frame_generator,
|
||||||
int target_fps);
|
int target_fps);
|
||||||
virtual ~FrameGeneratorCapturer();
|
virtual ~FrameGeneratorCapturer();
|
||||||
@ -37,7 +37,7 @@ class FrameGeneratorCapturer : public VideoCapturer {
|
|||||||
virtual void Stop() OVERRIDE;
|
virtual void Stop() OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FrameGeneratorCapturer(newapi::VideoSendStreamInput* input,
|
FrameGeneratorCapturer(VideoSendStreamInput* input,
|
||||||
FrameGenerator* frame_generator,
|
FrameGenerator* frame_generator,
|
||||||
int target_fps);
|
int target_fps);
|
||||||
bool Init();
|
bool Init();
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
void GenerateRandomSsrcs(newapi::VideoSendStream::Config* config,
|
void GenerateRandomSsrcs(VideoSendStream::Config* config,
|
||||||
std::map<uint32_t, bool>* reserved_ssrcs) {
|
std::map<uint32_t, bool>* reserved_ssrcs) {
|
||||||
size_t num_ssrcs = config->codec.numberOfSimulcastStreams;
|
size_t num_ssrcs = config->codec.numberOfSimulcastStreams;
|
||||||
std::vector<uint32_t>* ssrcs = &config->rtp.ssrcs;
|
std::vector<uint32_t>* ssrcs = &config->rtp.ssrcs;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
void GenerateRandomSsrcs(newapi::VideoSendStream::Config* config,
|
void GenerateRandomSsrcs(VideoSendStream::Config* config,
|
||||||
std::map<uint32_t, bool>* reserved_ssrcs);
|
std::map<uint32_t, bool>* reserved_ssrcs);
|
||||||
|
|
||||||
} // test
|
} // test
|
||||||
|
@ -14,9 +14,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
namespace newapi {
|
|
||||||
class PacketReceiver;
|
class PacketReceiver;
|
||||||
} // namespace newapi
|
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
class NullTransport : public newapi::Transport {
|
class NullTransport : public newapi::Transport {
|
||||||
|
@ -29,8 +29,8 @@ class RtpRtcpObserver {
|
|||||||
return &receive_transport_;
|
return &receive_transport_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetReceivers(newapi::PacketReceiver* send_transport_receiver,
|
void SetReceivers(PacketReceiver* send_transport_receiver,
|
||||||
newapi::PacketReceiver* receive_transport_receiver) {
|
PacketReceiver* receive_transport_receiver) {
|
||||||
send_transport_.SetReceiver(send_transport_receiver);
|
send_transport_.SetReceiver(send_transport_receiver);
|
||||||
receive_transport_.SetReceiver(receive_transport_receiver);
|
receive_transport_.SetReceiver(receive_transport_receiver);
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
VcmCapturer::VcmCapturer(webrtc::newapi::VideoSendStreamInput* input)
|
VcmCapturer::VcmCapturer(webrtc::VideoSendStreamInput* input)
|
||||||
: VideoCapturer(input), started_(false), vcm_(NULL), last_timestamp_(0) {}
|
: VideoCapturer(input), started_(false), vcm_(NULL), last_timestamp_(0) {}
|
||||||
|
|
||||||
bool VcmCapturer::Init(size_t width, size_t height, size_t target_fps) {
|
bool VcmCapturer::Init(size_t width, size_t height, size_t target_fps) {
|
||||||
@ -53,7 +53,7 @@ bool VcmCapturer::Init(size_t width, size_t height, size_t target_fps) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
VcmCapturer* VcmCapturer::Create(newapi::VideoSendStreamInput* input,
|
VcmCapturer* VcmCapturer::Create(VideoSendStreamInput* input,
|
||||||
size_t width, size_t height,
|
size_t width, size_t height,
|
||||||
size_t target_fps) {
|
size_t target_fps) {
|
||||||
VcmCapturer* vcm__capturer = new VcmCapturer(input);
|
VcmCapturer* vcm__capturer = new VcmCapturer(input);
|
||||||
|
@ -20,7 +20,7 @@ namespace test {
|
|||||||
|
|
||||||
class VcmCapturer : public VideoCapturer, public VideoCaptureDataCallback {
|
class VcmCapturer : public VideoCapturer, public VideoCaptureDataCallback {
|
||||||
public:
|
public:
|
||||||
static VcmCapturer* Create(newapi::VideoSendStreamInput* input, size_t width,
|
static VcmCapturer* Create(VideoSendStreamInput* input, size_t width,
|
||||||
size_t height, size_t target_fps);
|
size_t height, size_t target_fps);
|
||||||
virtual ~VcmCapturer();
|
virtual ~VcmCapturer();
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ class VcmCapturer : public VideoCapturer, public VideoCaptureDataCallback {
|
|||||||
OVERRIDE;
|
OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit VcmCapturer(newapi::VideoSendStreamInput* input);
|
explicit VcmCapturer(VideoSendStreamInput* input);
|
||||||
bool Init(size_t width, size_t height, size_t target_fps);
|
bool Init(size_t width, size_t height, size_t target_fps);
|
||||||
void Destroy();
|
void Destroy();
|
||||||
|
|
||||||
|
@ -28,10 +28,10 @@ class NullCapturer : public VideoCapturer {
|
|||||||
virtual void Stop() {}
|
virtual void Stop() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
VideoCapturer::VideoCapturer(newapi::VideoSendStreamInput* input)
|
VideoCapturer::VideoCapturer(VideoSendStreamInput* input)
|
||||||
: input_(input) {}
|
: input_(input) {}
|
||||||
|
|
||||||
VideoCapturer* VideoCapturer::Create(newapi::VideoSendStreamInput* input,
|
VideoCapturer* VideoCapturer::Create(VideoSendStreamInput* input,
|
||||||
size_t width,
|
size_t width,
|
||||||
size_t height,
|
size_t height,
|
||||||
int fps,
|
int fps,
|
||||||
|
@ -16,15 +16,13 @@ namespace webrtc {
|
|||||||
|
|
||||||
class Clock;
|
class Clock;
|
||||||
|
|
||||||
namespace newapi {
|
|
||||||
class VideoSendStreamInput;
|
class VideoSendStreamInput;
|
||||||
} // newapi
|
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
class VideoCapturer {
|
class VideoCapturer {
|
||||||
public:
|
public:
|
||||||
static VideoCapturer* Create(newapi::VideoSendStreamInput* input,
|
static VideoCapturer* Create(VideoSendStreamInput* input,
|
||||||
size_t width,
|
size_t width,
|
||||||
size_t height,
|
size_t height,
|
||||||
int fps,
|
int fps,
|
||||||
@ -35,8 +33,8 @@ class VideoCapturer {
|
|||||||
virtual void Stop() = 0;
|
virtual void Stop() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit VideoCapturer(newapi::VideoSendStreamInput* input);
|
explicit VideoCapturer(VideoSendStreamInput* input);
|
||||||
newapi::VideoSendStreamInput* input_;
|
VideoSendStreamInput* input_;
|
||||||
};
|
};
|
||||||
} // test
|
} // test
|
||||||
} // webrtc
|
} // webrtc
|
||||||
|
@ -16,8 +16,7 @@
|
|||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
class VideoRenderer : public webrtc::VideoRenderer {
|
||||||
class VideoRenderer : public newapi::VideoRenderer {
|
|
||||||
public:
|
public:
|
||||||
// Creates a platform-specific renderer if possible, or a null implementation
|
// Creates a platform-specific renderer if possible, or a null implementation
|
||||||
// if failing.
|
// if failing.
|
||||||
|
@ -174,9 +174,9 @@ TEST_P(RampUpTest, RampUpWithPadding) {
|
|||||||
test::DirectTransport receiver_transport;
|
test::DirectTransport receiver_transport;
|
||||||
StreamObserver stream_observer(3, &receiver_transport,
|
StreamObserver stream_observer(3, &receiver_transport,
|
||||||
Clock::GetRealTimeClock());
|
Clock::GetRealTimeClock());
|
||||||
newapi::VideoCall::Config call_config(&stream_observer);
|
VideoCall::Config call_config(&stream_observer);
|
||||||
scoped_ptr<newapi::VideoCall> call(newapi::VideoCall::Create(call_config));
|
scoped_ptr<VideoCall> call(VideoCall::Create(call_config));
|
||||||
newapi::VideoSendStream::Config send_config =
|
VideoSendStream::Config send_config =
|
||||||
call->GetDefaultSendConfig();
|
call->GetDefaultSendConfig();
|
||||||
|
|
||||||
receiver_transport.SetReceiver(call->Receiver());
|
receiver_transport.SetReceiver(call->Receiver());
|
||||||
@ -190,14 +190,14 @@ TEST_P(RampUpTest, RampUpWithPadding) {
|
|||||||
|
|
||||||
test::GenerateRandomSsrcs(&send_config, &reserved_ssrcs_);
|
test::GenerateRandomSsrcs(&send_config, &reserved_ssrcs_);
|
||||||
|
|
||||||
newapi::VideoSendStream* send_stream =
|
VideoSendStream* send_stream =
|
||||||
call->CreateSendStream(send_config);
|
call->CreateSendStream(send_config);
|
||||||
|
|
||||||
newapi::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;
|
||||||
newapi::VideoReceiveStream* receive_stream = call->CreateReceiveStream(
|
VideoReceiveStream* receive_stream = call->CreateReceiveStream(
|
||||||
receive_config);
|
receive_config);
|
||||||
|
|
||||||
scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer(
|
scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer(
|
||||||
@ -243,10 +243,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) {
|
||||||
newapi::VideoCall::Config sender_config(sender_transport);
|
VideoCall::Config sender_config(sender_transport);
|
||||||
newapi::VideoCall::Config receiver_config(receiver_transport);
|
VideoCall::Config receiver_config(receiver_transport);
|
||||||
sender_call_.reset(newapi::VideoCall::Create(sender_config));
|
sender_call_.reset(VideoCall::Create(sender_config));
|
||||||
receiver_call_.reset(newapi::VideoCall::Create(receiver_config));
|
receiver_call_.reset(VideoCall::Create(receiver_config));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateTestConfigs() {
|
void CreateTestConfigs() {
|
||||||
@ -302,14 +302,14 @@ class EngineTest : public ::testing::TestWithParam<EngineTestParams> {
|
|||||||
|
|
||||||
void ReceivesPliAndRecovers(int rtp_history_ms);
|
void ReceivesPliAndRecovers(int rtp_history_ms);
|
||||||
|
|
||||||
scoped_ptr<newapi::VideoCall> sender_call_;
|
scoped_ptr<VideoCall> sender_call_;
|
||||||
scoped_ptr<newapi::VideoCall> receiver_call_;
|
scoped_ptr<VideoCall> receiver_call_;
|
||||||
|
|
||||||
newapi::VideoSendStream::Config send_config_;
|
VideoSendStream::Config send_config_;
|
||||||
newapi::VideoReceiveStream::Config receive_config_;
|
VideoReceiveStream::Config receive_config_;
|
||||||
|
|
||||||
newapi::VideoSendStream* send_stream_;
|
VideoSendStream* send_stream_;
|
||||||
newapi::VideoReceiveStream* receive_stream_;
|
VideoReceiveStream* receive_stream_;
|
||||||
|
|
||||||
scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_;
|
scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_;
|
||||||
|
|
||||||
@ -513,7 +513,7 @@ class PliObserver : public test::RtpRtcpObserver {
|
|||||||
return SEND_PACKET;
|
return SEND_PACKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ReceiverRenderer : public newapi::VideoRenderer {
|
class ReceiverRenderer : public VideoRenderer {
|
||||||
public:
|
public:
|
||||||
ReceiverRenderer(PliObserver* observer)
|
ReceiverRenderer(PliObserver* observer)
|
||||||
: rendered_retransmission_(EventWrapper::Create()),
|
: rendered_retransmission_(EventWrapper::Create()),
|
||||||
|
@ -61,14 +61,14 @@ class FullStackTest : public ::testing::TestWithParam<FullStackTestParams> {
|
|||||||
std::map<uint32_t, bool> reserved_ssrcs_;
|
std::map<uint32_t, bool> reserved_ssrcs_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class VideoAnalyzer : public newapi::PacketReceiver,
|
class VideoAnalyzer : public PacketReceiver,
|
||||||
public newapi::Transport,
|
public newapi::Transport,
|
||||||
public newapi::VideoRenderer,
|
public VideoRenderer,
|
||||||
public newapi::VideoSendStreamInput {
|
public VideoSendStreamInput {
|
||||||
public:
|
public:
|
||||||
VideoAnalyzer(newapi::VideoSendStreamInput* input,
|
VideoAnalyzer(VideoSendStreamInput* input,
|
||||||
newapi::Transport* transport,
|
Transport* transport,
|
||||||
newapi::VideoRenderer* loopback_video,
|
VideoRenderer* loopback_video,
|
||||||
const char* test_label,
|
const char* test_label,
|
||||||
double avg_psnr_threshold,
|
double avg_psnr_threshold,
|
||||||
double avg_ssim_threshold,
|
double avg_ssim_threshold,
|
||||||
@ -200,10 +200,10 @@ class VideoAnalyzer : public newapi::PacketReceiver,
|
|||||||
|
|
||||||
void Wait() { trigger_->Wait(WEBRTC_EVENT_INFINITE); }
|
void Wait() { trigger_->Wait(WEBRTC_EVENT_INFINITE); }
|
||||||
|
|
||||||
newapi::VideoSendStreamInput* input_;
|
VideoSendStreamInput* input_;
|
||||||
newapi::Transport* transport_;
|
Transport* transport_;
|
||||||
newapi::VideoRenderer* renderer_;
|
VideoRenderer* renderer_;
|
||||||
newapi::PacketReceiver* receiver_;
|
PacketReceiver* receiver_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AddFrameComparison(const I420VideoFrame* reference_frame,
|
void AddFrameComparison(const I420VideoFrame* reference_frame,
|
||||||
@ -280,13 +280,13 @@ 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));
|
||||||
|
|
||||||
newapi::VideoCall::Config call_config(&analyzer);
|
VideoCall::Config call_config(&analyzer);
|
||||||
|
|
||||||
scoped_ptr<newapi::VideoCall> call(newapi::VideoCall::Create(call_config));
|
scoped_ptr<VideoCall> call(VideoCall::Create(call_config));
|
||||||
analyzer.receiver_ = call->Receiver();
|
analyzer.receiver_ = call->Receiver();
|
||||||
transport.SetReceiver(&analyzer);
|
transport.SetReceiver(&analyzer);
|
||||||
|
|
||||||
newapi::VideoSendStream::Config send_config = call->GetDefaultSendConfig();
|
VideoSendStream::Config send_config = call->GetDefaultSendConfig();
|
||||||
test::GenerateRandomSsrcs(&send_config, &reserved_ssrcs_);
|
test::GenerateRandomSsrcs(&send_config, &reserved_ssrcs_);
|
||||||
|
|
||||||
send_config.local_renderer = local_preview.get();
|
send_config.local_renderer = local_preview.get();
|
||||||
@ -299,7 +299,7 @@ TEST_P(FullStackTest, DISABLED_NoPacketLoss) {
|
|||||||
send_config.codec.startBitrate = params.bitrate;
|
send_config.codec.startBitrate = params.bitrate;
|
||||||
send_config.codec.maxBitrate = params.bitrate;
|
send_config.codec.maxBitrate = params.bitrate;
|
||||||
|
|
||||||
newapi::VideoSendStream* send_stream = call->CreateSendStream(send_config);
|
VideoSendStream* send_stream = call->CreateSendStream(send_config);
|
||||||
analyzer.input_ = send_stream->Input();
|
analyzer.input_ = send_stream->Input();
|
||||||
|
|
||||||
Clock* test_clock = Clock::GetRealTimeClock();
|
Clock* test_clock = Clock::GetRealTimeClock();
|
||||||
@ -314,12 +314,12 @@ TEST_P(FullStackTest, DISABLED_NoPacketLoss) {
|
|||||||
test_clock),
|
test_clock),
|
||||||
params.clip.fps));
|
params.clip.fps));
|
||||||
|
|
||||||
newapi::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;
|
||||||
|
|
||||||
newapi::VideoReceiveStream* receive_stream =
|
VideoReceiveStream* receive_stream =
|
||||||
call->CreateReceiveStream(receive_config);
|
call->CreateReceiveStream(receive_config);
|
||||||
|
|
||||||
receive_stream->StartReceive();
|
receive_stream->StartReceive();
|
||||||
|
@ -40,14 +40,14 @@ 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;
|
||||||
newapi::VideoCall::Config call_config(&transport);
|
VideoCall::Config call_config(&transport);
|
||||||
call_config.overuse_detection = true;
|
call_config.overuse_detection = true;
|
||||||
scoped_ptr<newapi::VideoCall> call(newapi::VideoCall::Create(call_config));
|
scoped_ptr<VideoCall> call(VideoCall::Create(call_config));
|
||||||
|
|
||||||
// Loopback, call sends to itself.
|
// Loopback, call sends to itself.
|
||||||
transport.SetReceiver(call->Receiver());
|
transport.SetReceiver(call->Receiver());
|
||||||
|
|
||||||
newapi::VideoSendStream::Config send_config = call->GetDefaultSendConfig();
|
VideoSendStream::Config send_config = call->GetDefaultSendConfig();
|
||||||
test::GenerateRandomSsrcs(&send_config, &reserved_ssrcs_);
|
test::GenerateRandomSsrcs(&send_config, &reserved_ssrcs_);
|
||||||
|
|
||||||
send_config.local_renderer = local_preview.get();
|
send_config.local_renderer = local_preview.get();
|
||||||
@ -63,7 +63,7 @@ TEST_F(LoopbackTest, Test) {
|
|||||||
send_config.codec.maxBitrate =
|
send_config.codec.maxBitrate =
|
||||||
static_cast<unsigned int>(test::flags::MaxBitrate());
|
static_cast<unsigned int>(test::flags::MaxBitrate());
|
||||||
|
|
||||||
newapi::VideoSendStream* send_stream = call->CreateSendStream(send_config);
|
VideoSendStream* send_stream = call->CreateSendStream(send_config);
|
||||||
|
|
||||||
Clock* test_clock = Clock::GetRealTimeClock();
|
Clock* test_clock = Clock::GetRealTimeClock();
|
||||||
|
|
||||||
@ -74,12 +74,12 @@ TEST_F(LoopbackTest, Test) {
|
|||||||
test::flags::Fps(),
|
test::flags::Fps(),
|
||||||
test_clock));
|
test_clock));
|
||||||
|
|
||||||
newapi::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();
|
||||||
|
|
||||||
newapi::VideoReceiveStream* receive_stream =
|
VideoReceiveStream* receive_stream =
|
||||||
call->CreateReceiveStream(receive_config);
|
call->CreateReceiveStream(receive_config);
|
||||||
|
|
||||||
receive_stream->StartReceive();
|
receive_stream->StartReceive();
|
||||||
|
@ -42,10 +42,10 @@ class SendTransportObserver : public test::NullTransport {
|
|||||||
class VideoSendStreamTest : public ::testing::Test {
|
class VideoSendStreamTest : public ::testing::Test {
|
||||||
protected:
|
protected:
|
||||||
static const uint32_t kSendSsrc;
|
static const uint32_t kSendSsrc;
|
||||||
void RunSendTest(newapi::VideoCall* call,
|
void RunSendTest(VideoCall* call,
|
||||||
const newapi::VideoSendStream::Config& config,
|
const VideoSendStream::Config& config,
|
||||||
SendTransportObserver* observer) {
|
SendTransportObserver* observer) {
|
||||||
newapi::VideoSendStream* send_stream = call->CreateSendStream(config);
|
VideoSendStream* send_stream = call->CreateSendStream(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(),
|
||||||
@ -81,10 +81,10 @@ TEST_F(VideoSendStreamTest, SendsSetSsrc) {
|
|||||||
}
|
}
|
||||||
} observer;
|
} observer;
|
||||||
|
|
||||||
newapi::VideoCall::Config call_config(&observer);
|
VideoCall::Config call_config(&observer);
|
||||||
scoped_ptr<newapi::VideoCall> call(newapi::VideoCall::Create(call_config));
|
scoped_ptr<VideoCall> call(VideoCall::Create(call_config));
|
||||||
|
|
||||||
newapi::VideoSendStream::Config send_config = call->GetDefaultSendConfig();
|
VideoSendStream::Config send_config = call->GetDefaultSendConfig();
|
||||||
send_config.rtp.ssrcs.push_back(kSendSsrc);
|
send_config.rtp.ssrcs.push_back(kSendSsrc);
|
||||||
|
|
||||||
RunSendTest(call.get(), send_config, &observer);
|
RunSendTest(call.get(), send_config, &observer);
|
||||||
@ -114,10 +114,10 @@ TEST_F(VideoSendStreamTest, SupportsCName) {
|
|||||||
}
|
}
|
||||||
} observer;
|
} observer;
|
||||||
|
|
||||||
newapi::VideoCall::Config call_config(&observer);
|
VideoCall::Config call_config(&observer);
|
||||||
scoped_ptr<newapi::VideoCall> call(newapi::VideoCall::Create(call_config));
|
scoped_ptr<VideoCall> call(VideoCall::Create(call_config));
|
||||||
|
|
||||||
newapi::VideoSendStream::Config send_config = call->GetDefaultSendConfig();
|
VideoSendStream::Config send_config = call->GetDefaultSendConfig();
|
||||||
send_config.rtp.ssrcs.push_back(kSendSsrc);
|
send_config.rtp.ssrcs.push_back(kSendSsrc);
|
||||||
send_config.rtp.c_name = kCName;
|
send_config.rtp.c_name = kCName;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user