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

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 1008463002: Fix MSE GC, make it less aggressive, more spec-compliant (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added new test case: GarbageCollection_SaveDataAtPlaybackPosition Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/blink/webmediaplayer_impl.h" 5 #include "media/blink/webmediaplayer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 10
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 demuxer_.reset(new FFmpegDemuxer(media_task_runner_, data_source_.get(), 882 demuxer_.reset(new FFmpegDemuxer(media_task_runner_, data_source_.get(),
883 encrypted_media_init_data_cb, media_log_)); 883 encrypted_media_init_data_cb, media_log_));
884 } else { 884 } else {
885 DCHECK(!chunk_demuxer_); 885 DCHECK(!chunk_demuxer_);
886 DCHECK(!data_source_); 886 DCHECK(!data_source_);
887 887
888 mse_log_cb = base::Bind(&MediaLog::AddLogEvent, media_log_); 888 mse_log_cb = base::Bind(&MediaLog::AddLogEvent, media_log_);
889 889
890 chunk_demuxer_ = new ChunkDemuxer( 890 chunk_demuxer_ = new ChunkDemuxer(
891 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnDemuxerOpened), 891 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnDemuxerOpened),
892 encrypted_media_init_data_cb, mse_log_cb, media_log_, true); 892 encrypted_media_init_data_cb, mse_log_cb,
893 base::Bind(&Pipeline::GetMediaTime, base::Unretained(&pipeline_)),
894 media_log_, true);
893 demuxer_.reset(chunk_demuxer_); 895 demuxer_.reset(chunk_demuxer_);
894 } 896 }
895 897
896 // ... and we're ready to go! 898 // ... and we're ready to go!
897 seeking_ = true; 899 seeking_ = true;
898 900
899 pipeline_.Start( 901 pipeline_.Start(
900 demuxer_.get(), 902 demuxer_.get(),
901 renderer_factory_->CreateRenderer( 903 renderer_factory_->CreateRenderer(
902 media_task_runner_, audio_source_provider_.get(), compositor_), 904 media_task_runner_, audio_source_provider_.get(), compositor_),
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 1010
1009 // pause() may be called after playback has ended and the HTMLMediaElement 1011 // pause() may be called after playback has ended and the HTMLMediaElement
1010 // requires that currentTime() == duration() after ending. We want to ensure 1012 // requires that currentTime() == duration() after ending. We want to ensure
1011 // |paused_time_| matches currentTime() in this case or a future seek() may 1013 // |paused_time_| matches currentTime() in this case or a future seek() may
1012 // incorrectly discard what it thinks is a seek to the existing time. 1014 // incorrectly discard what it thinks is a seek to the existing time.
1013 paused_time_ = 1015 paused_time_ =
1014 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); 1016 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime();
1015 } 1017 }
1016 1018
1017 } // namespace media 1019 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/blink/websourcebuffer_impl.h » ('j') | media/filters/chunk_demuxer_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698