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

Unified Diff: content/renderer/media/media_recorder_handler.cc

Issue 2610163006: MediaRecorder: support |timecode| and remove |m_ignoreMutedMedia|. (Closed)
Patch Set: Rebase video_capture_device_client.cc Created 3 years, 11 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 | content/renderer/media/media_recorder_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_recorder_handler.cc
diff --git a/content/renderer/media/media_recorder_handler.cc b/content/renderer/media/media_recorder_handler.cc
index 50feb23edc9f835cf93c12e388ef99a02eb26a08..cea6710b159b6332dcdd7feea700c524ba27d134 100644
--- a/content/renderer/media/media_recorder_handler.cc
+++ b/content/renderer/media/media_recorder_handler.cc
@@ -61,7 +61,9 @@ MediaRecorderHandler::~MediaRecorderHandler() {
DCHECK(main_render_thread_checker_.CalledOnValidThread());
// Send a |last_in_slice| to our |client_|.
if (client_)
- client_->writeData(nullptr, 0u, true);
+ client_->writeData(
+ nullptr, 0u, true,
+ (TimeTicks::Now() - TimeTicks::UnixEpoch()).InMillisecondsF());
}
bool MediaRecorderHandler::canSupportMimeType(
@@ -279,18 +281,20 @@ void MediaRecorderHandler::OnEncodedAudio(
void MediaRecorderHandler::WriteData(base::StringPiece data) {
DCHECK(main_render_thread_checker_.CalledOnValidThread());
+ const TimeTicks now = TimeTicks::Now();
// Non-buffered mode does not need to check timestamps.
if (timeslice_.is_zero()) {
- client_->writeData(data.data(), data.length(), true /* lastInSlice */);
+ client_->writeData(data.data(), data.length(), true /* lastInSlice */,
+ (now - TimeTicks::UnixEpoch()).InMillisecondsF());
return;
}
- const TimeTicks now = TimeTicks::Now();
const bool last_in_slice = now > slice_origin_timestamp_ + timeslice_;
DVLOG_IF(1, last_in_slice) << "Slice finished @ " << now;
if (last_in_slice)
slice_origin_timestamp_ = now;
- client_->writeData(data.data(), data.length(), last_in_slice);
+ client_->writeData(data.data(), data.length(), last_in_slice,
+ (now - TimeTicks::UnixEpoch()).InMillisecondsF());
}
void MediaRecorderHandler::OnVideoFrameForTesting(
« no previous file with comments | « no previous file | content/renderer/media/media_recorder_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698