diff --git a/webrtc/build/apk_tests.gyp b/webrtc/build/apk_tests.gyp index 7c9c903b0..27ca51dda 100644 --- a/webrtc/build/apk_tests.gyp +++ b/webrtc/build/apk_tests.gyp @@ -180,7 +180,7 @@ 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)video_engine_tests<(SHARED_LIB_SUFFIX)', }, 'dependencies': [ - '<(webrtc_root)/video_engine/video_engine.gyp:video_engine_tests', + '<(webrtc_root)/webrtc.gyp:video_engine_tests', ], 'includes': [ '../../../build/apk_test.gypi', diff --git a/webrtc/video_engine/internal/call.cc b/webrtc/call.cc similarity index 81% rename from webrtc/video_engine/internal/call.cc rename to webrtc/call.cc index 8b7f661dd..45f06eb1e 100644 --- a/webrtc/video_engine/internal/call.cc +++ b/webrtc/call.cc @@ -8,24 +8,78 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/internal/call.h" - #include #include #include #include +#include "webrtc/call.h" +#include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" +#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" #include "webrtc/system_wrappers/interface/trace.h" +#include "webrtc/video/video_receive_stream.h" +#include "webrtc/video/video_send_stream.h" #include "webrtc/video_engine/include/vie_base.h" #include "webrtc/video_engine/include/vie_codec.h" #include "webrtc/video_engine/include/vie_rtp_rtcp.h" -#include "webrtc/video_engine/internal/video_receive_stream.h" -#include "webrtc/video_engine/internal/video_send_stream.h" namespace webrtc { +namespace internal { +class Call : public webrtc::Call, public PacketReceiver { + public: + Call(webrtc::VideoEngine* video_engine, const Call::Config& config); + virtual ~Call(); + + virtual PacketReceiver* Receiver() OVERRIDE; + virtual std::vector GetVideoCodecs() OVERRIDE; + + virtual VideoSendStream::Config GetDefaultSendConfig() OVERRIDE; + + virtual VideoSendStream* CreateSendStream( + const VideoSendStream::Config& config) OVERRIDE; + + virtual SendStreamState* DestroySendStream( + webrtc::VideoSendStream* send_stream) OVERRIDE; + + virtual VideoReceiveStream::Config GetDefaultReceiveConfig() OVERRIDE; + + virtual VideoReceiveStream* CreateReceiveStream( + const VideoReceiveStream::Config& config) OVERRIDE; + + virtual void DestroyReceiveStream( + webrtc::VideoReceiveStream* receive_stream) OVERRIDE; + + virtual uint32_t SendBitrateEstimate() OVERRIDE; + virtual uint32_t ReceiveBitrateEstimate() OVERRIDE; + + virtual bool DeliverPacket(const uint8_t* packet, size_t length) OVERRIDE; + + private: + bool DeliverRtcp(const uint8_t* packet, size_t length); + bool DeliverRtp(const RTPHeader& header, + const uint8_t* packet, + size_t length); + + Call::Config config_; + + std::map receive_ssrcs_; + scoped_ptr receive_lock_; + + std::map send_ssrcs_; + scoped_ptr send_lock_; + + scoped_ptr rtp_header_parser_; + + webrtc::VideoEngine* video_engine_; + ViERTP_RTCP* rtp_rtcp_; + ViECodec* codec_; + + DISALLOW_COPY_AND_ASSIGN(Call); +}; +} // internal class TraceDispatcher : public TraceCallback { public: @@ -91,7 +145,7 @@ class TraceDispatcher : public TraceCallback { }; namespace internal { - TraceDispatcher* global_trace_dispatcher = NULL; +TraceDispatcher* global_trace_dispatcher = NULL; } // internal Call* Call::Create(const Call::Config& config) { @@ -145,7 +199,7 @@ std::vector Call::GetVideoCodecs() { VideoCodec codec; for (size_t i = 0; i < static_cast(codec_->NumberOfCodecs()); ++i) { - if (codec_->GetCodec(i, codec) == 0) { + if (codec_->GetCodec(static_cast(i), codec) == 0) { codecs.push_back(codec); } } diff --git a/webrtc/video_engine/new_include/call.h b/webrtc/call.h similarity index 95% rename from webrtc/video_engine/new_include/call.h rename to webrtc/call.h index f8fa9bed9..5239f5ac9 100644 --- a/webrtc/video_engine/new_include/call.h +++ b/webrtc/call.h @@ -14,8 +14,8 @@ #include #include "webrtc/common_types.h" -#include "webrtc/video_engine/new_include/video_receive_stream.h" -#include "webrtc/video_engine/new_include/video_send_stream.h" +#include "webrtc/video_receive_stream.h" +#include "webrtc/video_send_stream.h" namespace webrtc { diff --git a/webrtc/video_engine/test/call_tests.cc b/webrtc/call_tests.cc similarity index 98% rename from webrtc/video_engine/test/call_tests.cc rename to webrtc/call_tests.cc index 49cb8f505..6a8f34fdf 100644 --- a/webrtc/video_engine/test/call_tests.cc +++ b/webrtc/call_tests.cc @@ -13,19 +13,19 @@ #include "testing/gtest/include/gtest/gtest.h" +#include "webrtc/call.h" #include "webrtc/common_video/test/frame_generator.h" #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/event_wrapper.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" -#include "webrtc/video_engine/new_include/call.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_encoder.h" -#include "webrtc/video_engine/test/common/frame_generator_capturer.h" -#include "webrtc/video_engine/test/common/generate_ssrcs.h" -#include "webrtc/video_engine/test/common/rtp_rtcp_observer.h" +#include "webrtc/test/direct_transport.h" +#include "webrtc/test/fake_decoder.h" +#include "webrtc/test/fake_encoder.h" +#include "webrtc/test/frame_generator_capturer.h" +#include "webrtc/test/generate_ssrcs.h" +#include "webrtc/test/rtp_rtcp_observer.h" namespace webrtc { diff --git a/webrtc/video_engine/new_include/config.h b/webrtc/config.h similarity index 97% rename from webrtc/video_engine/new_include/config.h rename to webrtc/config.h index fec34bac3..a00a8f9ba 100644 --- a/webrtc/video_engine/new_include/config.h +++ b/webrtc/config.h @@ -8,6 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ +// TODO(pbos): Move Config from common.h to here. + #ifndef WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_ #define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_ diff --git a/webrtc/video_engine/new_include/frame_callback.h b/webrtc/frame_callback.h similarity index 100% rename from webrtc/video_engine/new_include/frame_callback.h rename to webrtc/frame_callback.h diff --git a/webrtc/video_engine/test/loopback.cc b/webrtc/loopback.cc similarity index 87% rename from webrtc/video_engine/test/loopback.cc rename to webrtc/loopback.cc index 93f2d839b..5c5dbce9b 100644 --- a/webrtc/video_engine/test/loopback.cc +++ b/webrtc/loopback.cc @@ -14,17 +14,17 @@ #include "testing/gtest/include/gtest/gtest.h" +#include "webrtc/call.h" #include "webrtc/system_wrappers/interface/clock.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" +#include "webrtc/test/direct_transport.h" +#include "webrtc/test/flags.h" +#include "webrtc/test/generate_ssrcs.h" +#include "webrtc/test/run_loop.h" +#include "webrtc/test/run_tests.h" +#include "webrtc/test/video_capturer.h" +#include "webrtc/test/video_renderer.h" #include "webrtc/typedefs.h" -#include "webrtc/video_engine/new_include/call.h" -#include "webrtc/video_engine/test/common/direct_transport.h" -#include "webrtc/video_engine/test/common/flags.h" -#include "webrtc/video_engine/test/common/generate_ssrcs.h" -#include "webrtc/video_engine/test/common/run_loop.h" -#include "webrtc/video_engine/test/common/run_tests.h" -#include "webrtc/video_engine/test/common/video_capturer.h" -#include "webrtc/video_engine/test/common/video_renderer.h" namespace webrtc { diff --git a/webrtc/video_engine/test/common/direct_transport.cc b/webrtc/test/direct_transport.cc similarity index 95% rename from webrtc/video_engine/test/common/direct_transport.cc rename to webrtc/test/direct_transport.cc index f4f364b14..8c7e3512a 100644 --- a/webrtc/video_engine/test/common/direct_transport.cc +++ b/webrtc/test/direct_transport.cc @@ -7,10 +7,11 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/direct_transport.h" +#include "webrtc/test/direct_transport.h" #include "testing/gtest/include/gtest/gtest.h" -#include "webrtc/video_engine/new_include/call.h" + +#include "webrtc/call.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/direct_transport.h b/webrtc/test/direct_transport.h similarity index 97% rename from webrtc/video_engine/test/common/direct_transport.h rename to webrtc/test/direct_transport.h index f1f3dda89..d4cb45aad 100644 --- a/webrtc/video_engine/test/common/direct_transport.h +++ b/webrtc/test/direct_transport.h @@ -18,7 +18,7 @@ #include "webrtc/system_wrappers/interface/event_wrapper.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" #include "webrtc/system_wrappers/interface/thread_wrapper.h" -#include "webrtc/video_engine/new_include/transport.h" +#include "webrtc/transport.h" namespace webrtc { diff --git a/webrtc/video_engine/test/common/fake_decoder.cc b/webrtc/test/fake_decoder.cc similarity index 96% rename from webrtc/video_engine/test/common/fake_decoder.cc rename to webrtc/test/fake_decoder.cc index 8125e5f39..a9e6f50e1 100644 --- a/webrtc/video_engine/test/common/fake_decoder.cc +++ b/webrtc/test/fake_decoder.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/fake_decoder.h" +#include "webrtc/test/fake_decoder.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/webrtc/video_engine/test/common/fake_decoder.h b/webrtc/test/fake_decoder.h similarity index 100% rename from webrtc/video_engine/test/common/fake_decoder.h rename to webrtc/test/fake_decoder.h diff --git a/webrtc/video_engine/test/common/fake_encoder.cc b/webrtc/test/fake_encoder.cc similarity index 98% rename from webrtc/video_engine/test/common/fake_encoder.cc rename to webrtc/test/fake_encoder.cc index 1db0f37e3..454be1654 100644 --- a/webrtc/video_engine/test/common/fake_encoder.cc +++ b/webrtc/test/fake_encoder.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/fake_encoder.h" +#include "webrtc/test/fake_encoder.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/webrtc/video_engine/test/common/fake_encoder.h b/webrtc/test/fake_encoder.h similarity index 100% rename from webrtc/video_engine/test/common/fake_encoder.h rename to webrtc/test/fake_encoder.h diff --git a/webrtc/video_engine/test/common/flags.cc b/webrtc/test/flags.cc similarity index 96% rename from webrtc/video_engine/test/common/flags.cc rename to webrtc/test/flags.cc index ec6e8f6e7..088efff0b 100644 --- a/webrtc/video_engine/test/common/flags.cc +++ b/webrtc/test/flags.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/flags.h" +#include "webrtc/test/flags.h" #include "gflags/gflags.h" diff --git a/webrtc/video_engine/test/common/flags.h b/webrtc/test/flags.h similarity index 100% rename from webrtc/video_engine/test/common/flags.h rename to webrtc/test/flags.h diff --git a/webrtc/video_engine/test/common/frame_generator_capturer.cc b/webrtc/test/frame_generator_capturer.cc similarity index 96% rename from webrtc/video_engine/test/common/frame_generator_capturer.cc rename to webrtc/test/frame_generator_capturer.cc index 08b3d2984..e04961dd2 100644 --- a/webrtc/video_engine/test/common/frame_generator_capturer.cc +++ b/webrtc/test/frame_generator_capturer.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/frame_generator_capturer.h" +#include "webrtc/test/frame_generator_capturer.h" #include "webrtc/common_video/test/frame_generator.h" #include "webrtc/system_wrappers/interface/clock.h" @@ -16,7 +16,7 @@ #include "webrtc/system_wrappers/interface/event_wrapper.h" #include "webrtc/system_wrappers/interface/sleep.h" #include "webrtc/system_wrappers/interface/thread_wrapper.h" -#include "webrtc/video_engine/new_include/video_send_stream.h" +#include "webrtc/video_send_stream.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/frame_generator_capturer.h b/webrtc/test/frame_generator_capturer.h similarity index 97% rename from webrtc/video_engine/test/common/frame_generator_capturer.h rename to webrtc/test/frame_generator_capturer.h index ad7fdebb0..5be6bb2cb 100644 --- a/webrtc/video_engine/test/common/frame_generator_capturer.h +++ b/webrtc/test/frame_generator_capturer.h @@ -11,8 +11,8 @@ #define WEBRTC_VIDEO_ENGINE_TEST_COMMON_FRAME_GENERATOR_CAPTURER_H_ #include "webrtc/system_wrappers/interface/scoped_ptr.h" +#include "webrtc/test/video_capturer.h" #include "webrtc/typedefs.h" -#include "webrtc/video_engine/test/common/video_capturer.h" namespace webrtc { diff --git a/webrtc/video_engine/test/common/generate_ssrcs.cc b/webrtc/test/generate_ssrcs.cc similarity index 90% rename from webrtc/video_engine/test/common/generate_ssrcs.cc rename to webrtc/test/generate_ssrcs.cc index 4d72dd687..ea7e28ddc 100644 --- a/webrtc/video_engine/test/common/generate_ssrcs.cc +++ b/webrtc/test/generate_ssrcs.cc @@ -8,12 +8,12 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/generate_ssrcs.h" +#include "webrtc/test/generate_ssrcs.h" #include #include -#include "webrtc/video_engine/new_include/video_send_stream.h" +#include "webrtc/video_send_stream.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/generate_ssrcs.h b/webrtc/test/generate_ssrcs.h similarity index 93% rename from webrtc/video_engine/test/common/generate_ssrcs.h rename to webrtc/test/generate_ssrcs.h index c21dcb07b..1d3c9d90b 100644 --- a/webrtc/video_engine/test/common/generate_ssrcs.h +++ b/webrtc/test/generate_ssrcs.h @@ -15,7 +15,7 @@ #include #include "webrtc/typedefs.h" -#include "webrtc/video_engine/new_include/video_send_stream.h" +#include "webrtc/video_send_stream.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/gl/gl_renderer.cc b/webrtc/test/gl/gl_renderer.cc similarity index 97% rename from webrtc/video_engine/test/common/gl/gl_renderer.cc rename to webrtc/test/gl/gl_renderer.cc index 5e229eb33..f2c7acd6c 100644 --- a/webrtc/video_engine/test/common/gl/gl_renderer.cc +++ b/webrtc/test/gl/gl_renderer.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/gl/gl_renderer.h" +#include "webrtc/test/gl/gl_renderer.h" #include diff --git a/webrtc/video_engine/test/common/gl/gl_renderer.h b/webrtc/test/gl/gl_renderer.h similarity index 95% rename from webrtc/video_engine/test/common/gl/gl_renderer.h rename to webrtc/test/gl/gl_renderer.h index 033f1cb1d..c2110b2e7 100644 --- a/webrtc/video_engine/test/common/gl/gl_renderer.h +++ b/webrtc/test/gl/gl_renderer.h @@ -17,8 +17,8 @@ #include #endif +#include "webrtc/test/video_renderer.h" #include "webrtc/typedefs.h" -#include "webrtc/video_engine/test/common/video_renderer.h" namespace webrtc { diff --git a/webrtc/video_engine/test/common/linux/glx_renderer.cc b/webrtc/test/linux/glx_renderer.cc similarity index 98% rename from webrtc/video_engine/test/common/linux/glx_renderer.cc rename to webrtc/test/linux/glx_renderer.cc index 312cb119a..c0b6130c2 100644 --- a/webrtc/video_engine/test/common/linux/glx_renderer.cc +++ b/webrtc/test/linux/glx_renderer.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/linux/glx_renderer.h" +#include "webrtc/test/linux/glx_renderer.h" #include diff --git a/webrtc/video_engine/test/common/linux/glx_renderer.h b/webrtc/test/linux/glx_renderer.h similarity index 95% rename from webrtc/video_engine/test/common/linux/glx_renderer.h rename to webrtc/test/linux/glx_renderer.h index 5a2f562a6..152b91530 100644 --- a/webrtc/video_engine/test/common/linux/glx_renderer.h +++ b/webrtc/test/linux/glx_renderer.h @@ -14,8 +14,8 @@ #include #include +#include "webrtc/test/gl/gl_renderer.h" #include "webrtc/typedefs.h" -#include "webrtc/video_engine/test/common/gl/gl_renderer.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/linux/video_renderer_linux.cc b/webrtc/test/linux/video_renderer_linux.cc similarity index 87% rename from webrtc/video_engine/test/common/linux/video_renderer_linux.cc rename to webrtc/test/linux/video_renderer_linux.cc index 2036a6ca7..6f69dd749 100644 --- a/webrtc/video_engine/test/common/linux/video_renderer_linux.cc +++ b/webrtc/test/linux/video_renderer_linux.cc @@ -7,9 +7,9 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/video_renderer.h" +#include "webrtc/test/video_renderer.h" -#include "webrtc/video_engine/test/common/linux/glx_renderer.h" +#include "webrtc/test/linux/glx_renderer.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/mac/run_tests.mm b/webrtc/test/mac/run_tests.mm similarity index 100% rename from webrtc/video_engine/test/common/mac/run_tests.mm rename to webrtc/test/mac/run_tests.mm diff --git a/webrtc/video_engine/test/common/mac/video_renderer_mac.h b/webrtc/test/mac/video_renderer_mac.h similarity index 94% rename from webrtc/video_engine/test/common/mac/video_renderer_mac.h rename to webrtc/test/mac/video_renderer_mac.h index f5e271da2..7701840c0 100644 --- a/webrtc/video_engine/test/common/mac/video_renderer_mac.h +++ b/webrtc/test/mac/video_renderer_mac.h @@ -11,8 +11,8 @@ #ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_MAC_VIDEO_RENDERER_MAC_H_ #define WEBRTC_VIDEO_ENGINE_TEST_COMMON_MAC_VIDEO_RENDERER_MAC_H_ +#include "webrtc/test/gl/gl_renderer.h" #include "webrtc/system_wrappers/interface/constructor_magic.h" -#include "webrtc/video_engine/test/common/gl/gl_renderer.h" @class CocoaWindow; diff --git a/webrtc/video_engine/test/common/mac/video_renderer_mac.mm b/webrtc/test/mac/video_renderer_mac.mm similarity index 98% rename from webrtc/video_engine/test/common/mac/video_renderer_mac.mm rename to webrtc/test/mac/video_renderer_mac.mm index ebbe02cc1..1bc05a190 100644 --- a/webrtc/video_engine/test/common/mac/video_renderer_mac.mm +++ b/webrtc/test/mac/video_renderer_mac.mm @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/mac/video_renderer_mac.h" +#include "webrtc/test/mac/video_renderer_mac.h" #import diff --git a/webrtc/video_engine/test/common/null_platform_renderer.cc b/webrtc/test/null_platform_renderer.cc similarity index 92% rename from webrtc/video_engine/test/common/null_platform_renderer.cc rename to webrtc/test/null_platform_renderer.cc index a79ee1d79..362f7db76 100644 --- a/webrtc/video_engine/test/common/null_platform_renderer.cc +++ b/webrtc/test/null_platform_renderer.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/video_renderer.h" +#include "webrtc/test/video_renderer.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/null_transport.cc b/webrtc/test/null_transport.cc similarity index 91% rename from webrtc/video_engine/test/common/null_transport.cc rename to webrtc/test/null_transport.cc index 1ce8e009a..1baeedfd4 100644 --- a/webrtc/video_engine/test/common/null_transport.cc +++ b/webrtc/test/null_transport.cc @@ -7,7 +7,7 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/null_transport.h" +#include "webrtc/test/null_transport.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/null_transport.h b/webrtc/test/null_transport.h similarity index 94% rename from webrtc/video_engine/test/common/null_transport.h rename to webrtc/test/null_transport.h index b63ad4077..f9839b9bb 100644 --- a/webrtc/video_engine/test/common/null_transport.h +++ b/webrtc/test/null_transport.h @@ -10,7 +10,7 @@ #ifndef WEBRTC_VIDEO_ENGINE_TEST_COMMON_NULL_TRANSPORT_H_ #define WEBRTC_VIDEO_ENGINE_TEST_COMMON_NULL_TRANSPORT_H_ -#include "webrtc/video_engine/new_include/transport.h" +#include "webrtc/transport.h" namespace webrtc { diff --git a/webrtc/video_engine/test/common/rtp_rtcp_observer.h b/webrtc/test/rtp_rtcp_observer.h similarity index 98% rename from webrtc/video_engine/test/common/rtp_rtcp_observer.h rename to webrtc/test/rtp_rtcp_observer.h index 2ceddf35f..ee06e2a95 100644 --- a/webrtc/video_engine/test/common/rtp_rtcp_observer.h +++ b/webrtc/test/rtp_rtcp_observer.h @@ -14,7 +14,7 @@ #include #include "webrtc/typedefs.h" -#include "webrtc/video_engine/new_include/video_send_stream.h" +#include "webrtc/video_send_stream.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/run_loop.cc b/webrtc/test/run_loop.cc similarity index 92% rename from webrtc/video_engine/test/common/run_loop.cc rename to webrtc/test/run_loop.cc index 730071d4c..cda1e10cf 100644 --- a/webrtc/video_engine/test/common/run_loop.cc +++ b/webrtc/test/run_loop.cc @@ -7,7 +7,7 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/run_loop.h" +#include "webrtc/test/run_loop.h" #include diff --git a/webrtc/video_engine/test/common/run_loop.h b/webrtc/test/run_loop.h similarity index 100% rename from webrtc/video_engine/test/common/run_loop.h rename to webrtc/test/run_loop.h diff --git a/webrtc/video_engine/test/common/run_tests.cc b/webrtc/test/run_tests.cc similarity index 100% rename from webrtc/video_engine/test/common/run_tests.cc rename to webrtc/test/run_tests.cc diff --git a/webrtc/video_engine/test/common/run_tests.h b/webrtc/test/run_tests.h similarity index 100% rename from webrtc/video_engine/test/common/run_tests.h rename to webrtc/test/run_tests.h diff --git a/webrtc/video_engine/test/common/statistics.cc b/webrtc/test/statistics.cc similarity index 94% rename from webrtc/video_engine/test/common/statistics.cc rename to webrtc/test/statistics.cc index f6e339d96..0075d4c9a 100644 --- a/webrtc/video_engine/test/common/statistics.cc +++ b/webrtc/test/statistics.cc @@ -7,7 +7,7 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/statistics.h" +#include "webrtc/test/statistics.h" #include diff --git a/webrtc/video_engine/test/common/statistics.h b/webrtc/test/statistics.h similarity index 100% rename from webrtc/video_engine/test/common/statistics.h rename to webrtc/test/statistics.h diff --git a/webrtc/video_engine/test/test_main.cc b/webrtc/test/test_main.cc similarity index 87% rename from webrtc/video_engine/test/test_main.cc rename to webrtc/test/test_main.cc index 68bdd4a3a..b57b032da 100644 --- a/webrtc/video_engine/test/test_main.cc +++ b/webrtc/test/test_main.cc @@ -10,9 +10,9 @@ #include "testing/gtest/include/gtest/gtest.h" +#include "webrtc/test/flags.h" +#include "webrtc/test/run_tests.h" #include "webrtc/test/testsupport/fileutils.h" -#include "webrtc/video_engine/test/common/flags.h" -#include "webrtc/video_engine/test/common/run_tests.h" int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); diff --git a/webrtc/video_engine/test/common/vcm_capturer.cc b/webrtc/test/vcm_capturer.cc similarity index 96% rename from webrtc/video_engine/test/common/vcm_capturer.cc rename to webrtc/test/vcm_capturer.cc index dc92b89f1..cbf7b1ffe 100644 --- a/webrtc/video_engine/test/common/vcm_capturer.cc +++ b/webrtc/test/vcm_capturer.cc @@ -8,10 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/vcm_capturer.h" +#include "webrtc/test/vcm_capturer.h" #include "webrtc/modules/video_capture/include/video_capture_factory.h" -#include "webrtc/video_engine/new_include/video_send_stream.h" +#include "webrtc/video_send_stream.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/vcm_capturer.h b/webrtc/test/vcm_capturer.h similarity index 96% rename from webrtc/video_engine/test/common/vcm_capturer.h rename to webrtc/test/vcm_capturer.h index 5b1df9ce9..40befe8d1 100644 --- a/webrtc/video_engine/test/common/vcm_capturer.h +++ b/webrtc/test/vcm_capturer.h @@ -13,7 +13,7 @@ #include "webrtc/common_types.h" #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" #include "webrtc/modules/video_capture/include/video_capture.h" -#include "webrtc/video_engine/test/common/video_capturer.h" +#include "webrtc/test/video_capturer.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/video_capturer.cc b/webrtc/test/video_capturer.cc similarity index 89% rename from webrtc/video_engine/test/common/video_capturer.cc rename to webrtc/test/video_capturer.cc index 9a1bd0c60..fc37648bc 100644 --- a/webrtc/video_engine/test/common/video_capturer.cc +++ b/webrtc/test/video_capturer.cc @@ -8,11 +8,11 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/video_capturer.h" +#include "webrtc/test/video_capturer.h" #include "webrtc/test/testsupport/fileutils.h" -#include "webrtc/video_engine/test/common/frame_generator_capturer.h" -#include "webrtc/video_engine/test/common/vcm_capturer.h" +#include "webrtc/test/frame_generator_capturer.h" +#include "webrtc/test/vcm_capturer.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/video_capturer.h b/webrtc/test/video_capturer.h similarity index 100% rename from webrtc/video_engine/test/common/video_capturer.h rename to webrtc/test/video_capturer.h diff --git a/webrtc/video_engine/test/common/video_renderer.cc b/webrtc/test/video_renderer.cc similarity index 94% rename from webrtc/video_engine/test/common/video_renderer.cc rename to webrtc/test/video_renderer.cc index 84aab894c..1a0c6133c 100644 --- a/webrtc/video_engine/test/common/video_renderer.cc +++ b/webrtc/test/video_renderer.cc @@ -7,7 +7,7 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/video_renderer.h" +#include "webrtc/test/video_renderer.h" // TODO(pbos): Android renderer diff --git a/webrtc/video_engine/test/common/video_renderer.h b/webrtc/test/video_renderer.h similarity index 96% rename from webrtc/video_engine/test/common/video_renderer.h rename to webrtc/test/video_renderer.h index a9baf4453..c8623270a 100644 --- a/webrtc/video_engine/test/common/video_renderer.h +++ b/webrtc/test/video_renderer.h @@ -12,7 +12,7 @@ #include -#include "webrtc/video_engine/new_include/video_renderer.h" +#include "webrtc/video_renderer.h" namespace webrtc { namespace test { diff --git a/webrtc/test/webrtc_test_common.gyp b/webrtc/test/webrtc_test_common.gyp new file mode 100644 index 000000000..1a7e579ae --- /dev/null +++ b/webrtc/test/webrtc_test_common.gyp @@ -0,0 +1,123 @@ +# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. +{ + 'includes': [ + '../build/common.gypi', + ], + 'targets': [ + { + 'target_name': 'webrtc_test_common', + 'type': 'static_library', + 'sources': [ + 'direct_transport.cc', + 'direct_transport.h', + 'fake_decoder.cc', + 'fake_decoder.h', + 'fake_encoder.cc', + 'fake_encoder.h', + 'flags.cc', + 'flags.h', + 'frame_generator_capturer.cc', + 'frame_generator_capturer.h', + 'generate_ssrcs.cc', + 'generate_ssrcs.h', + 'gl/gl_renderer.cc', + 'gl/gl_renderer.h', + 'linux/glx_renderer.cc', + 'linux/glx_renderer.h', + 'linux/video_renderer_linux.cc', + 'mac/run_tests.mm', + 'mac/video_renderer_mac.h', + 'mac/video_renderer_mac.mm', + 'null_platform_renderer.cc', + 'null_transport.cc', + 'null_transport.h', + 'rtp_rtcp_observer.h', + 'run_tests.cc', + 'run_tests.h', + 'run_loop.cc', + 'run_loop.h', + 'statistics.cc', + 'statistics.h', + 'vcm_capturer.cc', + 'vcm_capturer.h', + 'video_capturer.cc', + 'video_capturer.h', + 'video_renderer.cc', + 'video_renderer.h', + 'win/d3d_renderer.cc', + 'win/d3d_renderer.h', + 'win/run_loop_win.cc', + ], + 'conditions': [ + ['OS=="linux"', { + 'sources!': [ + 'null_platform_renderer.cc', + ], + }], + ['OS=="mac"', { + 'sources!': [ + 'null_platform_renderer.cc', + 'run_tests.cc', + ], + }], + ['OS!="linux" and OS!="mac"', { + 'sources!' : [ + 'gl/gl_renderer.cc', + 'gl/gl_renderer.h', + ], + }], + ['OS=="win"', { + 'sources!': [ + 'null_platform_renderer.cc', + 'run_loop.cc', + ], + }], + ], + 'direct_dependent_settings': { + 'conditions': [ + ['OS=="linux"', { + 'libraries': [ + '-lXext', + '-lX11', + '-lGL', + ], + }], + #TODO(pbos) : These dependencies should not have to be here, they + # aren't used by test code directly, only by components + # used by the tests. + ['OS=="android"', { + 'libraries' : [ + '-lGLESv2', '-llog', + ], + }], + ['OS=="mac"', { + 'xcode_settings' : { + 'OTHER_LDFLAGS' : [ + '-framework Foundation', + '-framework AppKit', + '-framework Cocoa', + '-framework OpenGL', + '-framework CoreVideo', + '-framework CoreAudio', + '-framework AudioToolbox', + ], + }, + }], + ], + }, + 'dependencies': [ + '<(DEPTH)/testing/gtest.gyp:gtest', + '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', + '<(webrtc_root)/modules/modules.gyp:video_capture_module', + '<(webrtc_root)/test/test.gyp:test_support', + '<(webrtc_root)/common_video/common_video.gyp:frame_generator', + ], + }, + ], +} diff --git a/webrtc/video_engine/test/common/win/d3d_renderer.cc b/webrtc/test/win/d3d_renderer.cc similarity index 99% rename from webrtc/video_engine/test/common/win/d3d_renderer.cc rename to webrtc/test/win/d3d_renderer.cc index 2f9b29f4a..7da8f445b 100644 --- a/webrtc/video_engine/test/common/win/d3d_renderer.cc +++ b/webrtc/test/win/d3d_renderer.cc @@ -7,7 +7,7 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/win/d3d_renderer.h" +#include "webrtc/test/win/d3d_renderer.h" #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" diff --git a/webrtc/video_engine/test/common/win/d3d_renderer.h b/webrtc/test/win/d3d_renderer.h similarity index 96% rename from webrtc/video_engine/test/common/win/d3d_renderer.h rename to webrtc/test/win/d3d_renderer.h index 38efa4628..e8b069261 100644 --- a/webrtc/video_engine/test/common/win/d3d_renderer.h +++ b/webrtc/test/win/d3d_renderer.h @@ -14,8 +14,8 @@ #include #include "webrtc/system_wrappers/interface/scoped_refptr.h" +#include "webrtc/test/video_renderer.h" #include "webrtc/typedefs.h" -#include "webrtc/video_engine/test/common/video_renderer.h" namespace webrtc { namespace test { diff --git a/webrtc/video_engine/test/common/win/run_loop_win.cc b/webrtc/test/win/run_loop_win.cc similarity index 93% rename from webrtc/video_engine/test/common/win/run_loop_win.cc rename to webrtc/test/win/run_loop_win.cc index c62eeb131..ec29cc5a6 100644 --- a/webrtc/video_engine/test/common/win/run_loop_win.cc +++ b/webrtc/test/win/run_loop_win.cc @@ -7,7 +7,7 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/test/common/run_loop.h" +#include "webrtc/test/run_loop.h" #include diff --git a/webrtc/video_engine/new_include/transport.h b/webrtc/transport.h similarity index 100% rename from webrtc/video_engine/new_include/transport.h rename to webrtc/transport.h diff --git a/webrtc/video/OWNERS b/webrtc/video/OWNERS new file mode 100644 index 000000000..506407499 --- /dev/null +++ b/webrtc/video/OWNERS @@ -0,0 +1,4 @@ +mflodman@webrtc.org +stefan@webrtc.org +wu@webrtc.org +mallinath@webrtc.org diff --git a/webrtc/video_engine/test/full_stack.cc b/webrtc/video/full_stack.cc similarity index 97% rename from webrtc/video_engine/test/full_stack.cc rename to webrtc/video/full_stack.cc index cc09a6a70..b154df301 100644 --- a/webrtc/video_engine/test/full_stack.cc +++ b/webrtc/video/full_stack.cc @@ -15,6 +15,7 @@ #include "gflags/gflags.h" #include "testing/gtest/include/gtest/gtest.h" +#include "webrtc/call.h" #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" #include "webrtc/system_wrappers/interface/clock.h" @@ -23,13 +24,12 @@ #include "webrtc/system_wrappers/interface/scoped_ptr.h" #include "webrtc/system_wrappers/interface/sleep.h" #include "webrtc/test/testsupport/fileutils.h" +#include "webrtc/test/direct_transport.h" +#include "webrtc/test/frame_generator_capturer.h" +#include "webrtc/test/generate_ssrcs.h" +#include "webrtc/test/statistics.h" +#include "webrtc/test/video_renderer.h" #include "webrtc/typedefs.h" -#include "webrtc/video_engine/new_include/call.h" -#include "webrtc/video_engine/test/common/direct_transport.h" -#include "webrtc/video_engine/test/common/frame_generator_capturer.h" -#include "webrtc/video_engine/test/common/generate_ssrcs.h" -#include "webrtc/video_engine/test/common/statistics.h" -#include "webrtc/video_engine/test/common/video_renderer.h" DEFINE_int32(seconds, 10, "Seconds to run each clip."); diff --git a/webrtc/video_engine/test/rampup_tests.cc b/webrtc/video/rampup_tests.cc similarity index 95% rename from webrtc/video_engine/test/rampup_tests.cc rename to webrtc/video/rampup_tests.cc index f263efa3d..c668458a3 100644 --- a/webrtc/video_engine/test/rampup_tests.cc +++ b/webrtc/video/rampup_tests.cc @@ -13,6 +13,7 @@ #include "testing/gtest/include/gtest/gtest.h" +#include "webrtc/call.h" #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" #include "webrtc/modules/rtp_rtcp/interface/receive_statistics.h" #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" @@ -21,12 +22,11 @@ #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/event_wrapper.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" -#include "webrtc/video_engine/new_include/call.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_encoder.h" -#include "webrtc/video_engine/test/common/frame_generator_capturer.h" -#include "webrtc/video_engine/test/common/generate_ssrcs.h" +#include "webrtc/test/direct_transport.h" +#include "webrtc/test/fake_decoder.h" +#include "webrtc/test/fake_encoder.h" +#include "webrtc/test/frame_generator_capturer.h" +#include "webrtc/test/generate_ssrcs.h" namespace webrtc { diff --git a/webrtc/video_engine/internal/transport_adapter.cc b/webrtc/video/transport_adapter.cc similarity index 95% rename from webrtc/video_engine/internal/transport_adapter.cc rename to webrtc/video/transport_adapter.cc index 635586ad1..1d3250419 100644 --- a/webrtc/video_engine/internal/transport_adapter.cc +++ b/webrtc/video/transport_adapter.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/internal/transport_adapter.h" +#include "webrtc/video/transport_adapter.h" namespace webrtc { namespace internal { diff --git a/webrtc/video_engine/internal/transport_adapter.h b/webrtc/video/transport_adapter.h similarity index 95% rename from webrtc/video_engine/internal/transport_adapter.h rename to webrtc/video/transport_adapter.h index a5e2e281b..3686f38a9 100644 --- a/webrtc/video_engine/internal/transport_adapter.h +++ b/webrtc/video/transport_adapter.h @@ -11,7 +11,7 @@ #define WEBRTC_VIDEO_ENGINE_INTERNAL_TRANSPORT_ADAPTER_H_ #include "webrtc/common_types.h" -#include "webrtc/video_engine/new_include/transport.h" +#include "webrtc/transport.h" namespace webrtc { namespace internal { diff --git a/webrtc/video_engine/internal/video_receive_stream.cc b/webrtc/video/video_receive_stream.cc similarity index 95% rename from webrtc/video_engine/internal/video_receive_stream.cc rename to webrtc/video/video_receive_stream.cc index a6a5875e0..a84c6d276 100644 --- a/webrtc/video_engine/internal/video_receive_stream.cc +++ b/webrtc/video/video_receive_stream.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/internal/video_receive_stream.h" +#include "webrtc/video/video_receive_stream.h" #include #include @@ -23,7 +23,7 @@ #include "webrtc/video_engine/include/vie_network.h" #include "webrtc/video_engine/include/vie_render.h" #include "webrtc/video_engine/include/vie_rtp_rtcp.h" -#include "webrtc/video_engine/new_include/video_receive_stream.h" +#include "webrtc/video_receive_stream.h" namespace webrtc { namespace internal { @@ -140,11 +140,13 @@ void VideoReceiveStream::GetCurrentReceiveCodec(VideoCodec* receive_codec) { } bool VideoReceiveStream::DeliverRtcp(const uint8_t* packet, size_t length) { - return network_->ReceivedRTCPPacket(channel_, packet, length) == 0; + return network_->ReceivedRTCPPacket( + channel_, packet, static_cast(length)) == 0; } bool VideoReceiveStream::DeliverRtp(const uint8_t* packet, size_t length) { - return network_->ReceivedRTPPacket(channel_, packet, length) == 0; + return network_->ReceivedRTPPacket( + channel_, packet, static_cast(length)) == 0; } int VideoReceiveStream::FrameSizeChange(unsigned int width, diff --git a/webrtc/video_engine/internal/video_receive_stream.h b/webrtc/video/video_receive_stream.h similarity index 95% rename from webrtc/video_engine/internal/video_receive_stream.h rename to webrtc/video/video_receive_stream.h index b5d095c46..c2352f486 100644 --- a/webrtc/video_engine/internal/video_receive_stream.h +++ b/webrtc/video/video_receive_stream.h @@ -15,9 +15,9 @@ #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" #include "webrtc/system_wrappers/interface/clock.h" +#include "webrtc/video/transport_adapter.h" #include "webrtc/video_engine/include/vie_render.h" -#include "webrtc/video_engine/internal/transport_adapter.h" -#include "webrtc/video_engine/new_include/video_receive_stream.h" +#include "webrtc/video_receive_stream.h" namespace webrtc { diff --git a/webrtc/video_engine/internal/video_send_stream.cc b/webrtc/video/video_send_stream.cc similarity index 93% rename from webrtc/video_engine/internal/video_send_stream.cc rename to webrtc/video/video_send_stream.cc index 70a691814..8814c359b 100644 --- a/webrtc/video_engine/internal/video_send_stream.cc +++ b/webrtc/video/video_send_stream.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/video_engine/internal/video_send_stream.h" +#include "webrtc/video/video_send_stream.h" #include @@ -23,7 +23,7 @@ #include "webrtc/video_engine/include/vie_image_process.h" #include "webrtc/video_engine/include/vie_network.h" #include "webrtc/video_engine/include/vie_rtp_rtcp.h" -#include "webrtc/video_engine/new_include/video_send_stream.h" +#include "webrtc/video_send_stream.h" namespace webrtc { namespace internal { @@ -101,16 +101,20 @@ VideoSendStream::VideoSendStream(newapi::Transport* transport, rtp_rtcp_->SetLocalSSRC(channel_, config_.rtp.ssrcs[0]); } else { for (size_t i = 0; i < config_.rtp.ssrcs.size(); ++i) { - rtp_rtcp_->SetLocalSSRC(channel_, config_.rtp.ssrcs[i], - kViEStreamTypeNormal, i); + rtp_rtcp_->SetLocalSSRC(channel_, + config_.rtp.ssrcs[i], + kViEStreamTypeNormal, + static_cast(i)); } } rtp_rtcp_->SetTransmissionSmoothingStatus(channel_, config_.pacing); if (!config_.rtp.rtx.ssrcs.empty()) { assert(config_.rtp.rtx.ssrcs.size() == config_.rtp.ssrcs.size()); for (size_t i = 0; i < config_.rtp.rtx.ssrcs.size(); ++i) { - rtp_rtcp_->SetLocalSSRC( - channel_, config_.rtp.rtx.ssrcs[i], kViEStreamTypeRtx, i); + rtp_rtcp_->SetLocalSSRC(channel_, + config_.rtp.rtx.ssrcs[i], + kViEStreamTypeRtx, + static_cast(i)); } if (config_.rtp.rtx.rtx_payload_type != 0) { @@ -169,7 +173,8 @@ VideoSendStream::VideoSendStream(newapi::Transport* transport, network_->RegisterSendTransport(channel_, transport_adapter_); // 28 to match packet overhead in ModuleRtpRtcpImpl. - network_->SetMTU(channel_, config_.rtp.max_packet_size + 28); + network_->SetMTU(channel_, + static_cast(config_.rtp.max_packet_size + 28)); if (config.encoder) { external_codec_ = ViEExternalCodec::GetInterface(video_engine); diff --git a/webrtc/video_engine/internal/video_send_stream.h b/webrtc/video/video_send_stream.h similarity index 92% rename from webrtc/video_engine/internal/video_send_stream.h rename to webrtc/video/video_send_stream.h index 27027eff9..304d825d3 100644 --- a/webrtc/video_engine/internal/video_send_stream.h +++ b/webrtc/video/video_send_stream.h @@ -14,9 +14,9 @@ #include #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" -#include "webrtc/video_engine/internal/transport_adapter.h" -#include "webrtc/video_engine/new_include/video_receive_stream.h" -#include "webrtc/video_engine/new_include/video_send_stream.h" +#include "webrtc/video/transport_adapter.h" +#include "webrtc/video_receive_stream.h" +#include "webrtc/video_send_stream.h" namespace webrtc { diff --git a/webrtc/video_engine/test/send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc similarity index 97% rename from webrtc/video_engine/test/send_stream_tests.cc rename to webrtc/video/video_send_stream_tests.cc index 2772104b4..edcbb2c93 100644 --- a/webrtc/video_engine/test/send_stream_tests.cc +++ b/webrtc/video/video_send_stream_tests.cc @@ -10,7 +10,10 @@ #include // max #include "testing/gtest/include/gtest/gtest.h" + +#include "webrtc/call.h" #include "webrtc/common_video/interface/i420_video_frame.h" +#include "webrtc/frame_callback.h" #include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h" #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" @@ -19,14 +22,12 @@ #include "webrtc/system_wrappers/interface/scoped_ptr.h" #include "webrtc/system_wrappers/interface/sleep.h" #include "webrtc/system_wrappers/interface/thread_wrapper.h" -#include "webrtc/video_engine/internal/transport_adapter.h" -#include "webrtc/video_engine/new_include/call.h" -#include "webrtc/video_engine/new_include/frame_callback.h" -#include "webrtc/video_engine/new_include/video_send_stream.h" -#include "webrtc/video_engine/test/common/direct_transport.h" -#include "webrtc/video_engine/test/common/fake_encoder.h" -#include "webrtc/video_engine/test/common/frame_generator_capturer.h" -#include "webrtc/video_engine/test/common/null_transport.h" +#include "webrtc/test/direct_transport.h" +#include "webrtc/test/fake_encoder.h" +#include "webrtc/test/frame_generator_capturer.h" +#include "webrtc/test/null_transport.h" +#include "webrtc/video/transport_adapter.h" +#include "webrtc/video_send_stream.h" namespace webrtc { diff --git a/webrtc/video/webrtc_video.gypi b/webrtc/video/webrtc_video.gypi new file mode 100644 index 000000000..78f4d1ae9 --- /dev/null +++ b/webrtc/video/webrtc_video.gypi @@ -0,0 +1,22 @@ +# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. +{ + 'variables': { + 'webrtc_video_dependencies': [ + '<(webrtc_root)/video_engine/video_engine.gyp:*', + ], + 'webrtc_video_sources': [ + 'video/transport_adapter.cc', + 'video/transport_adapter.h', + 'video/video_receive_stream.cc', + 'video/video_receive_stream.h', + 'video/video_send_stream.cc', + 'video/video_send_stream.h', + ], + }, +} diff --git a/webrtc/video_engine/internal/call.h b/webrtc/video_engine/internal/call.h deleted file mode 100644 index 7891bfd88..000000000 --- a/webrtc/video_engine/internal/call.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef WEBRTC_VIDEO_ENGINE_INTERNAL_CALL_H_ -#define WEBRTC_VIDEO_ENGINE_INTERNAL_CALL_H_ - -#include -#include - -#include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h" -#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h" -#include "webrtc/system_wrappers/interface/scoped_ptr.h" -#include "webrtc/video_engine/internal/video_receive_stream.h" -#include "webrtc/video_engine/internal/video_send_stream.h" -#include "webrtc/video_engine/new_include/call.h" - -namespace webrtc { - -class VideoEngine; -class ViERTP_RTCP; -class ViECodec; - -namespace internal { - -// TODO(pbos): Split out the packet receiver, should be sharable between -// VideoEngine and VoiceEngine. -class Call : public webrtc::Call, public PacketReceiver { - public: - Call(webrtc::VideoEngine* video_engine, const Call::Config& config); - virtual ~Call(); - - virtual PacketReceiver* Receiver() OVERRIDE; - virtual std::vector GetVideoCodecs() OVERRIDE; - - virtual VideoSendStream::Config GetDefaultSendConfig() OVERRIDE; - - virtual VideoSendStream* CreateSendStream( - const VideoSendStream::Config& config) OVERRIDE; - - virtual SendStreamState* DestroySendStream( - webrtc::VideoSendStream* send_stream) OVERRIDE; - - virtual VideoReceiveStream::Config GetDefaultReceiveConfig() OVERRIDE; - - virtual VideoReceiveStream* CreateReceiveStream( - const VideoReceiveStream::Config& config) OVERRIDE; - - virtual void DestroyReceiveStream( - webrtc::VideoReceiveStream* receive_stream) OVERRIDE; - - virtual uint32_t SendBitrateEstimate() OVERRIDE; - virtual uint32_t ReceiveBitrateEstimate() OVERRIDE; - - virtual bool DeliverPacket(const uint8_t* packet, size_t length) OVERRIDE; - - private: - bool DeliverRtcp(const uint8_t* packet, size_t length); - bool DeliverRtp(const RTPHeader& header, - const uint8_t* packet, - size_t length); - - Call::Config config_; - - std::map receive_ssrcs_; - scoped_ptr receive_lock_; - - std::map send_ssrcs_; - scoped_ptr send_lock_; - - scoped_ptr rtp_header_parser_; - - webrtc::VideoEngine* video_engine_; - ViERTP_RTCP* rtp_rtcp_; - ViECodec* codec_; - - DISALLOW_COPY_AND_ASSIGN(Call); -}; -} // namespace internal -} // namespace webrtc - -#endif // WEBRTC_VIDEO_ENGINE_INTERNAL_CALL_H_ diff --git a/webrtc/video_engine/test/tests.gypi b/webrtc/video_engine/test/tests.gypi deleted file mode 100644 index 8b94d568c..000000000 --- a/webrtc/video_engine/test/tests.gypi +++ /dev/null @@ -1,183 +0,0 @@ -# Copyright (c) 2013 The WebRTC project authors.All Rights Reserved. -# -# Use of this source code is governed by a BSD-style license -# that can be found in the LICENSE file in the root of the source -# tree. An additional intellectual property rights grant can be found -# in the file PATENTS.All contributing project authors may -# be found in the AUTHORS file in the root of the source tree. - -{ - 'targets': [ - { - 'target_name': 'video_tests_common', - 'type': 'static_library', - 'sources': [ - 'common/direct_transport.cc', - 'common/direct_transport.h', - 'common/fake_decoder.cc', - 'common/fake_decoder.h', - 'common/fake_encoder.cc', - 'common/fake_encoder.h', - 'common/flags.cc', - 'common/flags.h', - 'common/frame_generator_capturer.cc', - 'common/frame_generator_capturer.h', - 'common/generate_ssrcs.cc', - 'common/generate_ssrcs.h', - 'common/gl/gl_renderer.cc', - 'common/gl/gl_renderer.h', - 'common/linux/glx_renderer.cc', - 'common/linux/glx_renderer.h', - 'common/linux/video_renderer_linux.cc', - 'common/mac/run_tests.mm', - 'common/mac/video_renderer_mac.h', - 'common/mac/video_renderer_mac.mm', - 'common/null_platform_renderer.cc', - 'common/null_transport.cc', - 'common/null_transport.h', - 'common/rtp_rtcp_observer.h', - 'common/run_tests.cc', - 'common/run_tests.h', - 'common/run_loop.cc', - 'common/run_loop.h', - 'common/statistics.cc', - 'common/statistics.h', - 'common/vcm_capturer.cc', - 'common/vcm_capturer.h', - 'common/video_capturer.cc', - 'common/video_capturer.h', - 'common/video_renderer.cc', - 'common/video_renderer.h', - 'common/win/d3d_renderer.cc', - 'common/win/d3d_renderer.h', - 'common/win/run_loop_win.cc', - ], - 'conditions': [ - ['OS=="linux"', { - 'sources!': [ - 'common/null_platform_renderer.cc', - ], - }], - ['OS=="mac"', { - 'sources!': [ - 'common/null_platform_renderer.cc', - 'common/run_tests.cc', - ], - }], - ['OS!="linux" and OS!="mac"', { - 'sources!' : [ - 'common/gl/gl_renderer.cc', - 'common/gl/gl_renderer.h', - ], - }], - ['OS=="win"', { - 'sources!': [ - 'common/null_platform_renderer.cc', - 'common/run_loop.cc', - ], - }], - ], - 'direct_dependent_settings': { - 'conditions': [ - ['OS=="linux"', { - 'libraries': [ - '-lXext', - '-lX11', - '-lGL', - ], - }], - #TODO(pbos) : These dependencies should not have to be here, they - # aren't used by test code directly, only by components - # used by the tests. - ['OS=="android"', { - 'libraries' : [ - '-lGLESv2', '-llog', - ], - }], - ['OS=="mac"', { - 'xcode_settings' : { - 'OTHER_LDFLAGS' : [ - '-framework Foundation', - '-framework AppKit', - '-framework Cocoa', - '-framework OpenGL', - '-framework CoreVideo', - '-framework CoreAudio', - '-framework AudioToolbox', - ], - }, - }], - ], - }, - 'dependencies': [ - '<(DEPTH)/testing/gtest.gyp:gtest', - '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', - '<(webrtc_root)/modules/modules.gyp:video_capture_module', - '<(webrtc_root)/test/test.gyp:test_support', - 'video_engine_core', - '<(webrtc_root)/common_video/common_video.gyp:frame_generator', - ], - }, - { - 'target_name': 'video_loopback', - 'type': 'executable', - 'sources': [ - 'loopback.cc', - 'test_main.cc', - ], - 'dependencies': [ - '<(DEPTH)/testing/gtest.gyp:gtest', - 'video_tests_common', - ], - }, - { - 'target_name': 'video_engine_tests', - 'type': '<(gtest_target_type)', - 'sources': [ - 'call_tests.cc', - 'full_stack.cc', - 'rampup_tests.cc', - 'send_stream_tests.cc', - 'test_main.cc', - ], - 'dependencies': [ - '<(DEPTH)/testing/gtest.gyp:gtest', - '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', - 'video_tests_common', - ], - }, - ], # targets - 'conditions': [ - # TODO(henrike): remove build_with_chromium==1 when the bots are using - # Chromium's buildbots. - ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', { - 'targets': [ - { - 'target_name': 'video_engine_tests_apk_target', - 'type': 'none', - 'dependencies': [ - '<(apk_tests_path):video_engine_tests_apk', - ], - }, - ], - }], - ['test_isolation_mode != "noop"', { - 'targets': [ - { - 'target_name': 'video_engine_tests_run', - 'type': 'none', - 'dependencies': [ - 'video_engine_tests', - ], - 'includes': [ - '../../build/isolate.gypi', - 'video_engine_tests.isolate', - ], - 'sources': [ - 'video_engine_tests.isolate', - ], - }, - ], - }], - ], # conditions -} diff --git a/webrtc/video_engine/video_engine.gyp b/webrtc/video_engine/video_engine.gyp index cd0e9ad6e..c0be24585 100644 --- a/webrtc/video_engine/video_engine.gyp +++ b/webrtc/video_engine/video_engine.gyp @@ -17,7 +17,6 @@ 'includes': [ 'test/libvietest/libvietest.gypi', 'test/auto_test/vie_auto_test.gypi', - 'test/tests.gypi', ], 'conditions': [ ['OS=="android"', { diff --git a/webrtc/video_engine/video_engine_core.gypi b/webrtc/video_engine/video_engine_core.gypi index 8bae1fd7f..3793969d4 100644 --- a/webrtc/video_engine/video_engine_core.gypi +++ b/webrtc/video_engine/video_engine_core.gypi @@ -113,23 +113,6 @@ 'vie_render_manager.cc', 'vie_sender.cc', 'vie_sync_module.cc', - - # New VideoEngine API - 'internal/call.cc', - 'internal/call.h', - 'internal/transport_adapter.cc', - 'internal/transport_adapter.h', - 'internal/video_receive_stream.cc', - 'internal/video_receive_stream.h', - 'internal/video_send_stream.cc', - 'internal/video_send_stream.h', - 'new_include/call.h', - 'new_include/config.h', - 'new_include/frame_callback.h', - 'new_include/transport.h', - 'new_include/video_receive_stream.h', - 'new_include/video_renderer.h', - 'new_include/video_send_stream.h', ], # source # TODO(jschuh): Bug 1348: fix size_t to int truncations. 'msvs_disabled_warnings': [ 4267, ], diff --git a/webrtc/video_engine/vie_channel.cc b/webrtc/video_engine/vie_channel.cc index b766a6432..29139606e 100644 --- a/webrtc/video_engine/vie_channel.cc +++ b/webrtc/video_engine/vie_channel.cc @@ -29,7 +29,7 @@ #include "webrtc/video_engine/include/vie_errors.h" #include "webrtc/video_engine/include/vie_image_process.h" #include "webrtc/video_engine/include/vie_rtp_rtcp.h" -#include "webrtc/video_engine/new_include/frame_callback.h" +#include "webrtc/frame_callback.h" #include "webrtc/video_engine/vie_defines.h" namespace webrtc { diff --git a/webrtc/video_engine/vie_encoder.cc b/webrtc/video_engine/vie_encoder.cc index 1c6334afc..5bddda47c 100644 --- a/webrtc/video_engine/vie_encoder.cc +++ b/webrtc/video_engine/vie_encoder.cc @@ -28,7 +28,7 @@ #include "webrtc/system_wrappers/interface/trace_event.h" #include "webrtc/video_engine/include/vie_codec.h" #include "webrtc/video_engine/include/vie_image_process.h" -#include "webrtc/video_engine/new_include/frame_callback.h" +#include "webrtc/frame_callback.h" #include "webrtc/video_engine/vie_defines.h" namespace webrtc { diff --git a/webrtc/video_engine/vie_encoder.h b/webrtc/video_engine/vie_encoder.h index 2d7bae19a..7177f8ff6 100644 --- a/webrtc/video_engine/vie_encoder.h +++ b/webrtc/video_engine/vie_encoder.h @@ -21,7 +21,7 @@ #include "webrtc/modules/video_processing/main/interface/video_processing.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" #include "webrtc/typedefs.h" -#include "webrtc/video_engine/new_include/frame_callback.h" +#include "webrtc/frame_callback.h" #include "webrtc/video_engine/vie_defines.h" #include "webrtc/video_engine/vie_frame_provider_base.h" diff --git a/webrtc/video_engine/test/video_engine_tests.isolate b/webrtc/video_engine_tests.isolate similarity index 79% rename from webrtc/video_engine/test/video_engine_tests.isolate rename to webrtc/video_engine_tests.isolate index 2f22bda77..0c1e92df8 100644 --- a/webrtc/video_engine/test/video_engine_tests.isolate +++ b/webrtc/video_engine_tests.isolate @@ -12,24 +12,24 @@ # of a Chromium checkout, this is one level above the standalone build. 'variables': { 'isolate_dependency_untracked': [ - '../../../../data/', - '../../../../resources/', + '../../data/', + '../../resources/', ], }, }], ['OS=="linux" or OS=="mac" or OS=="win"', { 'variables': { 'command': [ - '../../../testing/test_env.py', - '../../../tools/swarm_client/googletest/run_test_cases.py', + '../testing/test_env.py', + '../tools/swarm_client/googletest/run_test_cases.py', '<(PRODUCT_DIR)/video_engine_tests<(EXECUTABLE_SUFFIX)', ], 'isolate_dependency_tracked': [ - '../../../testing/test_env.py', + '../testing/test_env.py', '<(PRODUCT_DIR)/video_engine_tests<(EXECUTABLE_SUFFIX)', ], 'isolate_dependency_untracked': [ - '../../../tools/swarm_client/', + '../tools/swarm_client/', ], }, }], diff --git a/webrtc/video_engine/new_include/video_receive_stream.h b/webrtc/video_receive_stream.h similarity index 95% rename from webrtc/video_engine/new_include/video_receive_stream.h rename to webrtc/video_receive_stream.h index b5b47c56b..f968c6621 100644 --- a/webrtc/video_engine/new_include/video_receive_stream.h +++ b/webrtc/video_receive_stream.h @@ -15,10 +15,10 @@ #include #include "webrtc/common_types.h" -#include "webrtc/video_engine/new_include/config.h" -#include "webrtc/video_engine/new_include/frame_callback.h" -#include "webrtc/video_engine/new_include/transport.h" -#include "webrtc/video_engine/new_include/video_renderer.h" +#include "webrtc/config.h" +#include "webrtc/frame_callback.h" +#include "webrtc/transport.h" +#include "webrtc/video_renderer.h" namespace webrtc { diff --git a/webrtc/video_engine/new_include/video_renderer.h b/webrtc/video_renderer.h similarity index 100% rename from webrtc/video_engine/new_include/video_renderer.h rename to webrtc/video_renderer.h diff --git a/webrtc/video_engine/new_include/video_send_stream.h b/webrtc/video_send_stream.h similarity index 96% rename from webrtc/video_engine/new_include/video_send_stream.h rename to webrtc/video_send_stream.h index f83ee0807..af33b7ca2 100644 --- a/webrtc/video_engine/new_include/video_send_stream.h +++ b/webrtc/video_send_stream.h @@ -15,9 +15,9 @@ #include #include "webrtc/common_types.h" -#include "webrtc/video_engine/new_include/config.h" -#include "webrtc/video_engine/new_include/frame_callback.h" -#include "webrtc/video_engine/new_include/video_renderer.h" +#include "webrtc/config.h" +#include "webrtc/frame_callback.h" +#include "webrtc/video_renderer.h" namespace webrtc { diff --git a/webrtc/webrtc.gyp b/webrtc/webrtc.gyp index 08d99acf7..9fe514cb0 100644 --- a/webrtc/webrtc.gyp +++ b/webrtc/webrtc.gyp @@ -5,9 +5,18 @@ # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. - { - 'includes': ['build/common.gypi',], + 'conditions': [ + ['include_tests==1', { + 'includes': [ + 'webrtc_tests.gypi', + ], + }], + ], + 'includes': [ + 'build/common.gypi', + 'video/webrtc_video.gypi', + ], 'variables': { 'webrtc_all_dependencies': [ 'common_audio/common_audio.gyp:*', @@ -21,10 +30,11 @@ }, 'targets': [ { - 'target_name': 'webrtc', + 'target_name': 'webrtc_all', 'type': 'none', 'dependencies': [ '<@(webrtc_all_dependencies)', + 'webrtc', ], 'conditions': [ ['include_tests==1', { @@ -33,6 +43,7 @@ 'test/metrics.gyp:*', 'test/test.gyp:*', 'tools/tools.gyp:*', + 'webrtc_tests', ], }], ['build_with_chromium==0 and OS=="android"', { @@ -42,5 +53,26 @@ }], ], }, + { + # TODO(pbos): This is intended to contain audio parts as well as soon as + # VoiceEngine moves to the same new API format. + 'target_name': 'webrtc', + 'type': 'static_library', + 'sources': [ + 'call.cc', + 'call.h', + 'config.h', + 'frame_callback.h', + 'transport.h', + 'video_receive_stream.h', + 'video_renderer.h', + 'video_send_stream.h', + + '<@(webrtc_video_sources)', + ], + 'dependencies': [ + '<@(webrtc_video_dependencies)', + ], + }, ], } diff --git a/webrtc/webrtc_tests.gypi b/webrtc/webrtc_tests.gypi new file mode 100644 index 000000000..407340300 --- /dev/null +++ b/webrtc/webrtc_tests.gypi @@ -0,0 +1,83 @@ +# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. +{ + 'targets': [ + { + 'target_name': 'webrtc_tests', + 'type': 'none', + 'dependencies': [ + 'video_engine_tests', + 'video_loopback', + ], + }, + { + 'target_name': 'video_loopback', + 'type': 'executable', + 'sources': [ + 'loopback.cc', + 'test/test_main.cc', + ], + 'dependencies': [ + '<(DEPTH)/testing/gtest.gyp:gtest', + 'test/webrtc_test_common.gyp:webrtc_test_common', + 'webrtc', + ], + }, + { + 'target_name': 'video_engine_tests', + 'type': '<(gtest_target_type)', + 'sources': [ + 'call_tests.cc', + 'video/full_stack.cc', + 'video/rampup_tests.cc', + 'video/video_send_stream_tests.cc', + 'test/test_main.cc', + ], + 'dependencies': [ + '<(DEPTH)/testing/gtest.gyp:gtest', + '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', + 'modules/modules.gyp:rtp_rtcp', + 'test/webrtc_test_common.gyp:webrtc_test_common', + 'webrtc', + ], + }, + ], + 'conditions': [ + # TODO(henrike): remove build_with_chromium==1 when the bots are using + # Chromium's buildbots. + ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', { + 'targets': [ + { + 'target_name': 'video_engine_tests_apk_target', + 'type': 'none', + 'dependencies': [ + '<(apk_tests_path):video_engine_tests_apk', + ], + }, + ], + }], + ['test_isolation_mode != "noop"', { + 'targets': [ + { + 'target_name': 'video_engine_tests_run', + 'type': 'none', + 'dependencies': [ + 'video_engine_tests', + ], + 'includes': [ + '../build/isolate.gypi', + 'video_engine_tests.isolate', + ], + 'sources': [ + 'video_engine_tests.isolate', + ], + }, + ], + }], + ], +}