OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/media_player_renderer_client.h" | 5 #include "content/renderer/media/android/media_player_renderer_client.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 | 8 |
9 namespace content { | 9 namespace content { |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // We do not know whether or not the media has Video before starting playback. | 108 // We do not know whether or not the media has Video before starting playback. |
109 // Conservatively assume we do. | 109 // Conservatively assume we do. |
110 // TODO(tguilbert): Consider using MIME types to determine presence of video. | 110 // TODO(tguilbert): Consider using MIME types to determine presence of video. |
111 // Alternatively, consider piping the HasVideo() from the MediaPlayerRenderer | 111 // Alternatively, consider piping the HasVideo() from the MediaPlayerRenderer |
112 // through the mojo::Renderer interface. | 112 // through the mojo::Renderer interface. |
113 return true; | 113 return true; |
114 } | 114 } |
115 | 115 |
116 void MediaPlayerRendererClient::OnFrameAvailable() { | 116 void MediaPlayerRendererClient::OnFrameAvailable() { |
117 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); | 117 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); |
118 // TODO(tguilbert): Force the repaint of the same frame. See crbug.com/636002. | 118 sink_->PaintSingleFrame(stream_texture_wrapper_->GetCurrentFrame(), true); |
119 sink_->PaintSingleFrame(stream_texture_wrapper_->GetCurrentFrame()); | |
120 } | 119 } |
121 | 120 |
122 void MediaPlayerRendererClient::OnError(media::PipelineStatus status) { | 121 void MediaPlayerRendererClient::OnError(media::PipelineStatus status) { |
123 client_->OnError(status); | 122 client_->OnError(status); |
124 } | 123 } |
125 | 124 |
126 void MediaPlayerRendererClient::OnEnded() { | 125 void MediaPlayerRendererClient::OnEnded() { |
127 client_->OnEnded(); | 126 client_->OnEnded(); |
128 } | 127 } |
129 | 128 |
(...skipping 15 matching lines...) Expand all Loading... |
145 const gfx::Size& size) { | 144 const gfx::Size& size) { |
146 stream_texture_wrapper_->UpdateTextureSize(size); | 145 stream_texture_wrapper_->UpdateTextureSize(size); |
147 client_->OnVideoNaturalSizeChange(size); | 146 client_->OnVideoNaturalSizeChange(size); |
148 } | 147 } |
149 | 148 |
150 void MediaPlayerRendererClient::OnVideoOpacityChange(bool opaque) { | 149 void MediaPlayerRendererClient::OnVideoOpacityChange(bool opaque) { |
151 client_->OnVideoOpacityChange(opaque); | 150 client_->OnVideoOpacityChange(opaque); |
152 } | 151 } |
153 | 152 |
154 } // namespace content | 153 } // namespace content |
OLD | NEW |