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

Unified Diff: webrtc/common_video/video_render_frames.cc

Issue 2071093002: Revert of Split IncomingVideoStream into two implementations, with smoothing and without. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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/video_render_frames.h ('k') | webrtc/media/base/videosinkinterface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/video_render_frames.cc
diff --git a/webrtc/common_video/video_render_frames.cc b/webrtc/common_video/video_render_frames.cc
index b818512acb1c93b8080bab0a2059fcd4fa58d440..62b317d966bee1e1cd7c081558574ae512b75089 100644
--- a/webrtc/common_video/video_render_frames.cc
+++ b/webrtc/common_video/video_render_frames.cc
@@ -17,21 +17,14 @@
#include "webrtc/system_wrappers/include/trace.h"
namespace webrtc {
-namespace {
-const uint32_t kEventMaxWaitTimeMs = 200;
+const uint32_t KEventMaxWaitTimeMs = 200;
const uint32_t kMinRenderDelayMs = 10;
const uint32_t kMaxRenderDelayMs = 500;
-uint32_t EnsureValidRenderDelay(uint32_t render_delay) {
- return (render_delay < kMinRenderDelayMs || render_delay > kMaxRenderDelayMs)
- ? kMinRenderDelayMs
- : render_delay;
+VideoRenderFrames::VideoRenderFrames()
+ : render_delay_ms_(10) {
}
-} // namespace
-
-VideoRenderFrames::VideoRenderFrames(uint32_t render_delay_ms)
- : render_delay_ms_(EnsureValidRenderDelay(render_delay_ms)) {}
int32_t VideoRenderFrames::AddFrame(const VideoFrame& new_frame) {
const int64_t time_now = rtc::TimeMillis();
@@ -70,9 +63,14 @@
return render_frame;
}
+int32_t VideoRenderFrames::ReleaseAllFrames() {
+ incoming_frames_.clear();
+ return 0;
+}
+
uint32_t VideoRenderFrames::TimeToNextFrameRelease() {
if (incoming_frames_.empty()) {
- return kEventMaxWaitTimeMs;
+ return KEventMaxWaitTimeMs;
}
const int64_t time_to_release = incoming_frames_.front().render_time_ms() -
render_delay_ms_ -
@@ -80,4 +78,18 @@
return time_to_release < 0 ? 0u : static_cast<uint32_t>(time_to_release);
}
+int32_t VideoRenderFrames::SetRenderDelay(
+ const uint32_t render_delay) {
+ if (render_delay < kMinRenderDelayMs ||
+ render_delay > kMaxRenderDelayMs) {
+ WEBRTC_TRACE(kTraceWarning, kTraceVideoRenderer,
+ -1, "%s(%d): Invalid argument.", __FUNCTION__,
+ render_delay);
+ return -1;
+ }
+
+ render_delay_ms_ = render_delay;
+ return 0;
+}
+
} // namespace webrtc
« no previous file with comments | « webrtc/common_video/video_render_frames.h ('k') | webrtc/media/base/videosinkinterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698