Replace fatal error with error log

While passing negative delta is an error it is not fatal and recovered next line.

Bug: None
Change-Id: I3b9ce234a7763ba92bd158c9eda8ba4bd7a06f4b
Reviewed-on: https://webrtc-review.googlesource.com/c/124702
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26916}
This commit is contained in:
Danil Chapovalov
2019-02-27 21:43:35 +01:00
committed by Commit Bot
parent cdea67dc5b
commit 328027b6c4
4 changed files with 12 additions and 11 deletions

View File

@ -266,10 +266,6 @@ specific_include_rules = {
"+modules/video_coding/include/video_codec_interface.h"
],
"video_timing\.h": [
"+rtc_base/numerics/safe_conversions.h",
],
"video_encoder_config\.h": [
"+rtc_base/ref_count.h",
],

View File

@ -11,10 +11,20 @@
#include "api/video/video_timing.h"
#include "api/array_view.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "rtc_base/strings/string_builder.h"
namespace webrtc {
uint16_t VideoSendTiming::GetDeltaCappedMs(int64_t base_ms, int64_t time_ms) {
if (time_ms < base_ms) {
RTC_DLOG(LS_ERROR) << "Delta " << (time_ms - base_ms)
<< "ms expected to be positive";
}
return rtc::saturated_cast<uint16_t>(time_ms - base_ms);
}
TimingFrameInfo::TimingFrameInfo()
: rtp_timestamp(0),
capture_time_ms(-1),

View File

@ -16,9 +16,6 @@
#include <limits>
#include <string>
#include "rtc_base/checks.h"
#include "rtc_base/numerics/safe_conversions.h"
namespace webrtc {
// Video timing timestamps in ms counted from capture_time_ms of a frame.
@ -46,10 +43,7 @@ struct VideoSendTiming {
// Used to fill this data structure as per
// https://webrtc.org/experiments/rtp-hdrext/video-timing/ extension stores
// 16-bit deltas of timestamps from packet capture time.
static uint16_t GetDeltaCappedMs(int64_t base_ms, int64_t time_ms) {
RTC_DCHECK_GE(time_ms, base_ms);
return rtc::saturated_cast<uint16_t>(time_ms - base_ms);
}
static uint16_t GetDeltaCappedMs(int64_t base_ms, int64_t time_ms);
uint16_t encode_start_delta_ms;
uint16_t encode_finish_delta_ms;

View File

@ -15,6 +15,7 @@
#include "modules/video_coding/utility/vp8_header_parser.h"
#include "modules/video_coding/utility/vp9_uncompressed_header_parser.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "rtc_base/time_utils.h"
#include "sdk/android/generated_video_jni/jni/VideoDecoderWrapper_jni.h"
#include "sdk/android/generated_video_jni/jni/VideoDecoder_jni.h"