diff --git a/webrtc/common_video/BUILD.gn b/webrtc/common_video/BUILD.gn index 308661a5c..e5cac4d44 100644 --- a/webrtc/common_video/BUILD.gn +++ b/webrtc/common_video/BUILD.gn @@ -19,13 +19,17 @@ source_set("common_video") { sources = [ "i420_buffer_pool.cc", "i420_video_frame.cc", + "incoming_video_stream.cc", "interface/i420_buffer_pool.h", + "interface/incoming_video_stream.h", "interface/video_frame_buffer.h", "libyuv/include/scaler.h", "libyuv/include/webrtc_libyuv.h", "libyuv/scaler.cc", "libyuv/webrtc_libyuv.cc", "video_frame_buffer.cc", + "video_render_frames.cc", + "video_render_frames.h", ] include_dirs = [ "../modules/interface" ] diff --git a/webrtc/common_video/common_video.gyp b/webrtc/common_video/common_video.gyp index 53e074baa..daac9ce9e 100644 --- a/webrtc/common_video/common_video.gyp +++ b/webrtc/common_video/common_video.gyp @@ -41,13 +41,17 @@ 'sources': [ 'i420_buffer_pool.cc', 'i420_video_frame.cc', + 'incoming_video_stream.cc', 'interface/i420_buffer_pool.h', + 'interface/incoming_video_stream.h', 'interface/video_frame_buffer.h', 'libyuv/include/scaler.h', 'libyuv/include/webrtc_libyuv.h', 'libyuv/scaler.cc', 'libyuv/webrtc_libyuv.cc', 'video_frame_buffer.cc', + 'video_render_frames.cc', + 'video_render_frames.h', ], }, ], # targets diff --git a/webrtc/modules/video_render/incoming_video_stream.cc b/webrtc/common_video/incoming_video_stream.cc similarity index 98% rename from webrtc/modules/video_render/incoming_video_stream.cc rename to webrtc/common_video/incoming_video_stream.cc index d5352d61c..471e6dc9f 100644 --- a/webrtc/modules/video_render/incoming_video_stream.cc +++ b/webrtc/common_video/incoming_video_stream.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/modules/video_render/incoming_video_stream.h" +#include "webrtc/common_video/interface/incoming_video_stream.h" #include @@ -22,7 +22,7 @@ #endif #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" -#include "webrtc/modules/video_render/video_render_frames.h" +#include "webrtc/common_video/video_render_frames.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/event_wrapper.h" #include "webrtc/system_wrappers/interface/thread_wrapper.h" diff --git a/webrtc/modules/video_render/incoming_video_stream.h b/webrtc/common_video/interface/incoming_video_stream.h similarity index 86% rename from webrtc/modules/video_render/incoming_video_stream.h rename to webrtc/common_video/interface/incoming_video_stream.h index c636e13a4..f5383b543 100644 --- a/webrtc/modules/video_render/incoming_video_stream.h +++ b/webrtc/common_video/interface/incoming_video_stream.h @@ -8,19 +8,25 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_INCOMING_VIDEO_STREAM_H_ -#define WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_INCOMING_VIDEO_STREAM_H_ +#ifndef WEBRTC_COMMON_VIDEO_INTERFACE_INCOMING_VIDEO_STREAM_H_ +#define WEBRTC_COMMON_VIDEO_INTERFACE_INCOMING_VIDEO_STREAM_H_ #include "webrtc/base/scoped_ptr.h" #include "webrtc/base/thread_annotations.h" -#include "webrtc/modules/video_render/include/video_render.h" +#include "webrtc/common_video/video_render_frames.h" namespace webrtc { class CriticalSectionWrapper; class EventTimerWrapper; class ThreadWrapper; -class VideoRenderCallback; -class VideoRenderFrames; + +class VideoRenderCallback { + public: + virtual int32_t RenderFrame(const uint32_t streamId, + const I420VideoFrame& videoFrame) = 0; + protected: + virtual ~VideoRenderCallback() {} +}; class IncomingVideoStream : public VideoRenderCallback { public: @@ -92,4 +98,4 @@ class IncomingVideoStream : public VideoRenderCallback { } // namespace webrtc -#endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_INCOMING_VIDEO_STREAM_H_ +#endif // WEBRTC_COMMON_VIDEO_INTERFACE_INCOMING_VIDEO_STREAM_H_ diff --git a/webrtc/modules/video_render/video_render_frames.cc b/webrtc/common_video/video_render_frames.cc similarity index 98% rename from webrtc/modules/video_render/video_render_frames.cc rename to webrtc/common_video/video_render_frames.cc index 107625c88..abd1e43df 100644 --- a/webrtc/modules/video_render/video_render_frames.cc +++ b/webrtc/common_video/video_render_frames.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/modules/video_render/video_render_frames.h" +#include "webrtc/common_video/video_render_frames.h" #include diff --git a/webrtc/modules/video_render/video_render_frames.h b/webrtc/common_video/video_render_frames.h similarity index 82% rename from webrtc/modules/video_render/video_render_frames.h rename to webrtc/common_video/video_render_frames.h index 4094074c6..31d15970b 100644 --- a/webrtc/modules/video_render/video_render_frames.h +++ b/webrtc/common_video/video_render_frames.h @@ -8,12 +8,14 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_VIDEO_RENDER_FRAMES_H_ // NOLINT -#define WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_VIDEO_RENDER_FRAMES_H_ // NOLINT +#ifndef WEBRTC_COMMON_VIDEO_VIDEO_RENDER_FRAMES_H_ +#define WEBRTC_COMMON_VIDEO_VIDEO_RENDER_FRAMES_H_ + +#include #include -#include "webrtc/modules/video_render/include/video_render.h" +#include "webrtc/video_frame.h" namespace webrtc { @@ -54,4 +56,4 @@ class VideoRenderFrames { } // namespace webrtc -#endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_VIDEO_RENDER_FRAMES_H_ // NOLINT +#endif // WEBRTC_COMMON_VIDEO_VIDEO_RENDER_FRAMES_H_ diff --git a/webrtc/modules/video_render/BUILD.gn b/webrtc/modules/video_render/BUILD.gn index 1e3e3e5d3..8a2b9231b 100644 --- a/webrtc/modules/video_render/BUILD.gn +++ b/webrtc/modules/video_render/BUILD.gn @@ -15,10 +15,6 @@ source_set("video_render_module") { "i_video_render.h", "include/video_render.h", "include/video_render_defines.h", - "incoming_video_stream.cc", - "incoming_video_stream.h", - "video_render_frames.cc", - "video_render_frames.h", "video_render_impl.h", ] diff --git a/webrtc/modules/video_render/include/video_render_defines.h b/webrtc/modules/video_render/include/video_render_defines.h index 4479c3755..f8f48035e 100644 --- a/webrtc/modules/video_render/include/video_render_defines.h +++ b/webrtc/modules/video_render/include/video_render_defines.h @@ -12,8 +12,8 @@ #define WEBRTC_MODULES_VIDEO_RENDER_MAIN_INTERFACE_VIDEO_RENDER_DEFINES_H_ #include "webrtc/common_types.h" +#include "webrtc/common_video/interface/incoming_video_stream.h" #include "webrtc/modules/interface/module_common_types.h" -#include "webrtc/video_frame.h" namespace webrtc { @@ -42,20 +42,6 @@ enum VideoRenderError kRenderPerformanceAlarm = 1 }; -// The object a module user uses to send new frames to the renderer -// One object is used for each incoming stream -class VideoRenderCallback -{ -public: - virtual int32_t RenderFrame(const uint32_t streamId, - const I420VideoFrame& videoFrame) = 0; - -protected: - virtual ~VideoRenderCallback() - { - } -}; - // Feedback class to be implemented by module user class VideoRenderFeedback { diff --git a/webrtc/modules/video_render/video_render.gypi b/webrtc/modules/video_render/video_render.gypi index 12ef354ee..c7b0d7f17 100644 --- a/webrtc/modules/video_render/video_render.gypi +++ b/webrtc/modules/video_render/video_render.gypi @@ -27,10 +27,6 @@ 'i_video_render.h', 'include/video_render.h', 'include/video_render_defines.h', - 'incoming_video_stream.cc', - 'incoming_video_stream.h', - 'video_render_frames.cc', - 'video_render_frames.h', 'video_render_impl.h', ], }, diff --git a/webrtc/modules/video_render/video_render_impl.cc b/webrtc/modules/video_render/video_render_impl.cc index 96a266c7d..513efa87c 100644 --- a/webrtc/modules/video_render/video_render_impl.cc +++ b/webrtc/modules/video_render/video_render_impl.cc @@ -10,11 +10,11 @@ #include +#include "webrtc/common_video/interface/incoming_video_stream.h" #include "webrtc/engine_configurations.h" #include "webrtc/modules/video_render/external/video_render_external_impl.h" -#include "webrtc/modules/video_render/include/video_render_defines.h" -#include "webrtc/modules/video_render/incoming_video_stream.h" #include "webrtc/modules/video_render/i_video_render.h" +#include "webrtc/modules/video_render/include/video_render_defines.h" #include "webrtc/modules/video_render/video_render_impl.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/trace.h" diff --git a/webrtc/modules/video_render/video_render_internal_impl.cc b/webrtc/modules/video_render/video_render_internal_impl.cc index 42cebf94d..e7f39a542 100644 --- a/webrtc/modules/video_render/video_render_internal_impl.cc +++ b/webrtc/modules/video_render/video_render_internal_impl.cc @@ -10,10 +10,10 @@ #include +#include "webrtc/common_video/interface/incoming_video_stream.h" #include "webrtc/engine_configurations.h" #include "webrtc/modules/video_render/i_video_render.h" #include "webrtc/modules/video_render/include/video_render_defines.h" -#include "webrtc/modules/video_render/incoming_video_stream.h" #include "webrtc/modules/video_render/video_render_impl.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/trace.h" diff --git a/webrtc/video/video_receive_stream.h b/webrtc/video/video_receive_stream.h index 3d08f7275..1a57a4214 100644 --- a/webrtc/video/video_receive_stream.h +++ b/webrtc/video/video_receive_stream.h @@ -15,9 +15,9 @@ #include "webrtc/base/scoped_ptr.h" #include "webrtc/call.h" +#include "webrtc/common_video/interface/incoming_video_stream.h" #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" #include "webrtc/modules/video_render/include/video_render_defines.h" -#include "webrtc/modules/video_render/incoming_video_stream.h" #include "webrtc/system_wrappers/interface/clock.h" #include "webrtc/video/encoded_frame_callback_adapter.h" #include "webrtc/video/receive_statistics_proxy.h" diff --git a/webrtc/video_engine/vie_channel.cc b/webrtc/video_engine/vie_channel.cc index 9b179b731..f0cc56c15 100644 --- a/webrtc/video_engine/vie_channel.cc +++ b/webrtc/video_engine/vie_channel.cc @@ -15,6 +15,7 @@ #include "webrtc/base/checks.h" #include "webrtc/common.h" +#include "webrtc/common_video/interface/incoming_video_stream.h" #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" #include "webrtc/experiments.h" #include "webrtc/frame_callback.h" @@ -26,7 +27,6 @@ #include "webrtc/modules/video_coding/main/interface/video_coding.h" #include "webrtc/modules/video_processing/main/interface/video_processing.h" #include "webrtc/modules/video_render/include/video_render_defines.h" -#include "webrtc/modules/video_render/incoming_video_stream.h" #include "webrtc/system_wrappers/interface/critical_section_wrapper.h" #include "webrtc/system_wrappers/interface/logging.h" #include "webrtc/system_wrappers/interface/metrics.h"