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

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 1796403002: Don't mark a WebMediaPlayer as idle until it has size and first frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | content/renderer/media/renderer_webmediaplayer_delegate.cc » ('j') | no next file with comments »
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 "content/renderer/media/android/webmediaplayer_android.h" 5 #include "content/renderer/media/android/webmediaplayer_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 stream_texture_factory_->SetStreamTextureSize( 961 stream_texture_factory_->SetStreamTextureSize(
962 stream_id_, gfx::Size(natural_size_.width, natural_size_.height)); 962 stream_id_, gfx::Size(natural_size_.width, natural_size_.height));
963 cached_stream_texture_size_ = natural_size_; 963 cached_stream_texture_size_ = natural_size_;
964 } 964 }
965 965
966 // Lazily allocate compositing layer. 966 // Lazily allocate compositing layer.
967 if (!video_weblayer_) { 967 if (!video_weblayer_) {
968 video_weblayer_.reset(new cc_blink::WebLayerImpl( 968 video_weblayer_.reset(new cc_blink::WebLayerImpl(
969 cc::VideoLayer::Create(this, media::VIDEO_ROTATION_0))); 969 cc::VideoLayer::Create(this, media::VIDEO_ROTATION_0)));
970 client_->setWebLayer(video_weblayer_.get()); 970 client_->setWebLayer(video_weblayer_.get());
971
972 // If we're paused after we receive metadata for the first time, tell the
wolenetz 2016/03/15 01:08:24 For MSE midstream configchange that changes the wi
wolenetz 2016/03/15 01:11:18 Dale pointed out this block happens only once (if
973 // delegate we can now be safely suspended due to inactivity if a subsequent
974 // play event does not occur.
975 if (paused() && delegate_)
976 delegate_->DidPause(delegate_id_, false);
971 } 977 }
972 } 978 }
973 979
974 void WebMediaPlayerAndroid::OnTimeUpdate(base::TimeDelta current_timestamp, 980 void WebMediaPlayerAndroid::OnTimeUpdate(base::TimeDelta current_timestamp,
975 base::TimeTicks current_time_ticks) { 981 base::TimeTicks current_time_ticks) {
976 DCHECK(main_thread_checker_.CalledOnValidThread()); 982 DCHECK(main_thread_checker_.CalledOnValidThread());
977 983
978 if (seeking()) 984 if (seeking())
979 return; 985 return;
980 986
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; 1669 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER;
1664 } else if (is_hls_url == is_hls) { 1670 } else if (is_hls_url == is_hls) {
1665 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; 1671 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER;
1666 } 1672 }
1667 UMA_HISTOGRAM_ENUMERATION( 1673 UMA_HISTOGRAM_ENUMERATION(
1668 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", 1674 "Media.Android.IsHttpLiveStreamingMediaPredictionResult",
1669 result, PREDICTION_RESULT_MAX); 1675 result, PREDICTION_RESULT_MAX);
1670 } 1676 }
1671 1677
1672 } // namespace content 1678 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/renderer_webmediaplayer_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698