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