Commit 25b7a7a6 authored by magjed's avatar magjed Committed by Commit Bot

Fix timestamp issue in RTCVideoEncoder for native frames

Speculative fix for WebRTC test failures. See issue for more information.

BUG=732345
TBR=emircan

Review-Url: https://codereview.chromium.org/2934793002
Cr-Commit-Position: refs/heads/master@{#478627}
parent 418d1a8b
......@@ -618,9 +618,16 @@ void RTCVideoEncoder::Impl::EncodeOneFrame() {
}
if (requires_copy) {
// TODO(magjed/emircan): This check is needed in order for the
// |pending_timestamps_| DHCECK below to not fail. It shouldn't be
// necessary.
const bool use_media_timestamp =
frame && (frame->HasTextures() ||
frame->storage_type() == media::VideoFrame::STORAGE_SHMEM);
const base::TimeDelta timestamp =
frame ? frame->timestamp()
: base::TimeDelta::FromMilliseconds(next_frame->ntp_time_ms());
use_media_timestamp
? frame->timestamp()
: base::TimeDelta::FromMilliseconds(next_frame->ntp_time_ms());
base::SharedMemory* input_buffer = input_buffers_[index].get();
frame = media::VideoFrame::WrapExternalSharedMemory(
media::PIXEL_FORMAT_I420, input_frame_coded_size_,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment