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

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: Renderer should return kNoTimestamp when theres no time source yet. 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
« no previous file with comments | « no previous file | media/blink/websourcebuffer_impl.h » ('j') | media/filters/chunk_demuxer.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 demuxer_.reset(new FFmpegDemuxer(media_task_runner_, data_source_.get(), 885 demuxer_.reset(new FFmpegDemuxer(media_task_runner_, data_source_.get(),
886 encrypted_media_init_data_cb, media_log_)); 886 encrypted_media_init_data_cb, media_log_));
887 } else { 887 } else {
888 DCHECK(!chunk_demuxer_); 888 DCHECK(!chunk_demuxer_);
889 DCHECK(!data_source_); 889 DCHECK(!data_source_);
890 890
891 mse_log_cb = base::Bind(&MediaLog::AddLogEvent, media_log_); 891 mse_log_cb = base::Bind(&MediaLog::AddLogEvent, media_log_);
892 892
893 chunk_demuxer_ = new ChunkDemuxer( 893 chunk_demuxer_ = new ChunkDemuxer(
894 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnDemuxerOpened), 894 BIND_TO_RENDER_LOOP(&WebMediaPlayerImpl::OnDemuxerOpened),
895 encrypted_media_init_data_cb, mse_log_cb, media_log_, true); 895 encrypted_media_init_data_cb, mse_log_cb,
896 base::Bind(&Pipeline::GetMediaTime, base::Unretained(&pipeline_)),
897 media_log_, true);
896 demuxer_.reset(chunk_demuxer_); 898 demuxer_.reset(chunk_demuxer_);
897 } 899 }
898 900
899 // ... and we're ready to go! 901 // ... and we're ready to go!
900 seeking_ = true; 902 seeking_ = true;
901 903
902 pipeline_.Start( 904 pipeline_.Start(
903 demuxer_.get(), 905 demuxer_.get(),
904 renderer_factory_->CreateRenderer( 906 renderer_factory_->CreateRenderer(
905 media_task_runner_, audio_source_provider_.get(), compositor_), 907 media_task_runner_, audio_source_provider_.get(), compositor_),
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 1013
1012 // pause() may be called after playback has ended and the HTMLMediaElement 1014 // pause() may be called after playback has ended and the HTMLMediaElement
1013 // requires that currentTime() == duration() after ending. We want to ensure 1015 // requires that currentTime() == duration() after ending. We want to ensure
1014 // |paused_time_| matches currentTime() in this case or a future seek() may 1016 // |paused_time_| matches currentTime() in this case or a future seek() may
1015 // incorrectly discard what it thinks is a seek to the existing time. 1017 // incorrectly discard what it thinks is a seek to the existing time.
1016 paused_time_ = 1018 paused_time_ =
1017 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); 1019 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime();
1018 } 1020 }
1019 1021
1020 } // namespace media 1022 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/blink/websourcebuffer_impl.h » ('j') | media/filters/chunk_demuxer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698