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

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

Issue 1996763002: Make painting a single frame a permanent API on VideoRendererSink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments. Created 4 years, 7 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 #include <string> 10 #include <string>
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 } 905 }
906 if (time_updated) 906 if (time_updated)
907 should_notify_time_changed_ = true; 907 should_notify_time_changed_ = true;
908 } 908 }
909 909
910 void WebMediaPlayerImpl::OnPipelineSuspended() { 910 void WebMediaPlayerImpl::OnPipelineSuspended() {
911 #if defined(OS_ANDROID) 911 #if defined(OS_ANDROID)
912 if (isRemote()) { 912 if (isRemote()) {
913 scoped_refptr<VideoFrame> frame = cast_impl_.GetCastingBanner(); 913 scoped_refptr<VideoFrame> frame = cast_impl_.GetCastingBanner();
914 if (frame) 914 if (frame)
915 compositor_->PaintFrameUsingOldRenderingPath(frame); 915 compositor_->PaintSingleFrame(frame);
916 } 916 }
917 #endif 917 #endif
918 918
919 // If we're not in an aggressive buffering state, tell the data source we have 919 // If we're not in an aggressive buffering state, tell the data source we have
920 // enough data so that it may release the connection. 920 // enough data so that it may release the connection.
921 if (buffering_strategy_ != 921 if (buffering_strategy_ !=
922 BufferedDataSource::BUFFERING_STRATEGY_AGGRESSIVE) { 922 BufferedDataSource::BUFFERING_STRATEGY_AGGRESSIVE) {
923 if (data_source_) 923 if (data_source_)
924 data_source_->OnBufferingHaveEnough(true); 924 data_source_->OnBufferingHaveEnough(true);
925 } 925 }
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 client_->playbackStateChanged(); 1191 client_->playbackStateChanged();
1192 client_->disconnectedFromRemoteDevice(); 1192 client_->disconnectedFromRemoteDevice();
1193 1193
1194 UpdatePlayState(); 1194 UpdatePlayState();
1195 } 1195 }
1196 1196
1197 void WebMediaPlayerImpl::SuspendForRemote() { 1197 void WebMediaPlayerImpl::SuspendForRemote() {
1198 if (pipeline_controller_.IsPipelineSuspended()) { 1198 if (pipeline_controller_.IsPipelineSuspended()) {
1199 scoped_refptr<VideoFrame> frame = cast_impl_.GetCastingBanner(); 1199 scoped_refptr<VideoFrame> frame = cast_impl_.GetCastingBanner();
1200 if (frame) 1200 if (frame)
1201 compositor_->PaintFrameUsingOldRenderingPath(frame); 1201 compositor_->PaintSingleFrame(frame);
1202 } 1202 }
1203 1203
1204 UpdatePlayState(); 1204 UpdatePlayState();
1205 } 1205 }
1206 1206
1207 gfx::Size WebMediaPlayerImpl::GetCanvasSize() const { 1207 gfx::Size WebMediaPlayerImpl::GetCanvasSize() const {
1208 if (!video_weblayer_) 1208 if (!video_weblayer_)
1209 return pipeline_metadata_.natural_size; 1209 return pipeline_metadata_.natural_size;
1210 1210
1211 return video_weblayer_->bounds(); 1211 return video_weblayer_->bounds();
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 << ", Video: " << stats.video_memory_usage << ", DataSource: " 1609 << ", Video: " << stats.video_memory_usage << ", DataSource: "
1610 << (data_source_ ? data_source_->GetMemoryUsage() : 0) 1610 << (data_source_ ? data_source_->GetMemoryUsage() : 0)
1611 << ", Demuxer: " << demuxer_memory_usage; 1611 << ", Demuxer: " << demuxer_memory_usage;
1612 1612
1613 const int64_t delta = current_memory_usage - last_reported_memory_usage_; 1613 const int64_t delta = current_memory_usage - last_reported_memory_usage_;
1614 last_reported_memory_usage_ = current_memory_usage; 1614 last_reported_memory_usage_ = current_memory_usage;
1615 adjust_allocated_memory_cb_.Run(delta); 1615 adjust_allocated_memory_cb_.Run(delta);
1616 } 1616 }
1617 1617
1618 } // namespace media 1618 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/video_frame_compositor_unittest.cc ('k') | media/filters/video_renderer_algorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698