Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: webrtc/common_video/include/incoming_video_stream.h

Issue 2071473002: Reland of Split IncomingVideoStream into two implementations, with smoothing and without. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: add explicit Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/common_video/common_video_unittests.gyp ('k') | webrtc/common_video/incoming_video_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/include/incoming_video_stream.h
diff --git a/webrtc/common_video/include/incoming_video_stream.h b/webrtc/common_video/include/incoming_video_stream.h
index f96a23dbeabaff21de247594d11f0fa77ae00800..1fbee7a2df63b99af23cd3deea1e442e7a1124a5 100644
--- a/webrtc/common_video/include/incoming_video_stream.h
+++ b/webrtc/common_video/include/incoming_video_stream.h
@@ -15,30 +15,20 @@
#include "webrtc/base/criticalsection.h"
#include "webrtc/base/platform_thread.h"
+#include "webrtc/base/task_queue.h"
#include "webrtc/base/thread_annotations.h"
+#include "webrtc/base/thread_checker.h"
#include "webrtc/common_video/video_render_frames.h"
#include "webrtc/media/base/videosinkinterface.h"
namespace webrtc {
class EventTimerWrapper;
-
class IncomingVideoStream : public rtc::VideoSinkInterface<VideoFrame> {
public:
- explicit IncomingVideoStream(bool disable_prerenderer_smoothing);
- ~IncomingVideoStream();
-
- // Overrides VideoSinkInterface
- void OnFrame(const VideoFrame& video_frame) override;
-
- // Callback for file recording, snapshot, ...
- void SetExternalCallback(rtc::VideoSinkInterface<VideoFrame>* render_object);
-
- // Start/Stop.
- int32_t Start();
- int32_t Stop();
-
- int32_t SetExpectedRenderDelay(int32_t delay_ms);
+ IncomingVideoStream(int32_t delay_ms,
+ rtc::VideoSinkInterface<VideoFrame>* callback);
+ ~IncomingVideoStream() override;
protected:
static bool IncomingVideoStreamThreadFun(void* obj);
@@ -49,26 +39,36 @@ class IncomingVideoStream : public rtc::VideoSinkInterface<VideoFrame> {
enum { kEventMaxWaitTimeMs = 100 };
enum { kFrameRatePeriodMs = 1000 };
- void DeliverFrame(const VideoFrame& video_frame);
+ void OnFrame(const VideoFrame& video_frame) override;
+
+ rtc::ThreadChecker main_thread_checker_;
+ rtc::ThreadChecker render_thread_checker_;
+ rtc::ThreadChecker decoder_thread_checker_;
- const bool disable_prerenderer_smoothing_;
- // Critsects in allowed to enter order.
- rtc::CriticalSection stream_critsect_;
- rtc::CriticalSection thread_critsect_;
rtc::CriticalSection buffer_critsect_;
- // TODO(pbos): Make plain member and stop resetting this thread, just
- // start/stoping it is enough.
- std::unique_ptr<rtc::PlatformThread> incoming_render_thread_
- GUARDED_BY(thread_critsect_);
+ rtc::PlatformThread incoming_render_thread_;
std::unique_ptr<EventTimerWrapper> deliver_buffer_event_;
- bool running_ GUARDED_BY(stream_critsect_);
- rtc::VideoSinkInterface<VideoFrame>* external_callback_
- GUARDED_BY(thread_critsect_);
- const std::unique_ptr<VideoRenderFrames> render_buffers_
+ rtc::VideoSinkInterface<VideoFrame>* const external_callback_;
+ std::unique_ptr<VideoRenderFrames> render_buffers_
GUARDED_BY(buffer_critsect_);
};
+class IncomingVideoStreamNoSmoothing
+ : public rtc::VideoSinkInterface<VideoFrame> {
+ public:
+ explicit IncomingVideoStreamNoSmoothing(
+ rtc::VideoSinkInterface<VideoFrame>* callback);
+
+ private:
+ // Overrides VideoSinkInterface
+ void OnFrame(const VideoFrame& video_frame) override;
+
+ rtc::ThreadChecker decoder_thread_checker_;
+ rtc::VideoSinkInterface<VideoFrame>* const callback_;
+ rtc::TaskQueue queue_;
+};
+
} // namespace webrtc
#endif // WEBRTC_COMMON_VIDEO_INCLUDE_INCOMING_VIDEO_STREAM_H_
« no previous file with comments | « webrtc/common_video/common_video_unittests.gyp ('k') | webrtc/common_video/incoming_video_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698