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

Unified Diff: webrtc/video/video_stream_decoder.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/video/video_stream_decoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_stream_decoder.cc
diff --git a/webrtc/video/video_stream_decoder.cc b/webrtc/video/video_stream_decoder.cc
index 6797353161dce52cb74a8d8dac1370a7bce871c1..4caa9dea0367df17891726f659cb20431a0b4c38 100644
--- a/webrtc/video/video_stream_decoder.cc
+++ b/webrtc/video/video_stream_decoder.cc
@@ -17,6 +17,7 @@
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
#include "webrtc/common_video/include/frame_callback.h"
+#include "webrtc/common_video/include/incoming_video_stream.h"
#include "webrtc/modules/video_coding/video_coding_impl.h"
#include "webrtc/modules/video_processing/include/video_processing.h"
#include "webrtc/system_wrappers/include/metrics.h"
@@ -31,9 +32,9 @@
VCMFrameTypeCallback* vcm_frame_type_callback,
VCMPacketRequestCallback* vcm_packet_request_callback,
bool enable_nack,
- bool enable_fec,
+ bool enable_fec, // TODO(philipel): Actually use this.
ReceiveStatisticsProxy* receive_statistics_proxy,
- rtc::VideoSinkInterface<VideoFrame>* incoming_video_stream,
+ IncomingVideoStream* incoming_video_stream,
I420FrameCallback* pre_render_callback)
: video_receiver_(video_receiver),
receive_stats_callback_(receive_statistics_proxy),
@@ -50,10 +51,16 @@
video_receiver_->RegisterFrameTypeCallback(vcm_frame_type_callback);
video_receiver_->RegisterReceiveStatisticsCallback(this);
video_receiver_->RegisterDecoderTimingCallback(this);
+ static const int kDefaultRenderDelayMs = 10;
+ video_receiver_->SetRenderDelay(kDefaultRenderDelayMs);
- VCMVideoProtection video_protection =
- enable_nack ? (enable_fec ? kProtectionNackFEC : kProtectionNack)
- : kProtectionNone;
+ VCMVideoProtection video_protection = kProtectionNone;
+ if (enable_nack) {
+ if (enable_fec)
+ video_protection = kProtectionNackFEC;
+ else
+ video_protection = kProtectionNack;
+ }
VCMDecodeErrorMode decode_error_mode = enable_nack ? kNoErrors : kWithErrors;
video_receiver_->SetVideoProtection(video_protection, true);
@@ -63,14 +70,7 @@
video_receiver_->RegisterPacketRequestCallback(packet_request_callback);
}
-VideoStreamDecoder::~VideoStreamDecoder() {
- // Unset all the callback pointers that we set in the ctor.
- video_receiver_->RegisterPacketRequestCallback(nullptr);
- video_receiver_->RegisterDecoderTimingCallback(nullptr);
- video_receiver_->RegisterReceiveStatisticsCallback(nullptr);
- video_receiver_->RegisterFrameTypeCallback(nullptr);
- video_receiver_->RegisterReceiveCallback(nullptr);
-}
+VideoStreamDecoder::~VideoStreamDecoder() {}
// Do not acquire the lock of |video_receiver_| in this function. Decode
// callback won't necessarily be called from the decoding thread. The decoding
@@ -84,9 +84,7 @@
}
}
- if (incoming_video_stream_)
- incoming_video_stream_->OnFrame(video_frame);
-
+ incoming_video_stream_->OnFrame(video_frame);
return 0;
}
« no previous file with comments | « webrtc/video/video_stream_decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698