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

Unified Diff: content/renderer/media/gpu/rtc_video_encoder.cc

Issue 2934793002: Fix timestamp issue in RTCVideoEncoder for native frames (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/gpu/rtc_video_encoder.cc
diff --git a/content/renderer/media/gpu/rtc_video_encoder.cc b/content/renderer/media/gpu/rtc_video_encoder.cc
index d9433d7c09d0c5615f7b12123a6fda603cb70d7e..df1fe60c8d19ce59c17cb5d18b9475598e053892 100644
--- a/content/renderer/media/gpu/rtc_video_encoder.cc
+++ b/content/renderer/media/gpu/rtc_video_encoder.cc
@@ -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_,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698