OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/media/android/webmediaplayer_android.h" | 5 #include "webkit/media/android/webmediaplayer_android.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "media/base/android/media_player_bridge.h" | 9 #include "media/base/android/media_player_bridge.h" |
10 #include "net/base/mime_util.h" | 10 #include "net/base/mime_util.h" |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 } | 328 } |
329 | 329 |
330 void WebMediaPlayerAndroid::OnVideoSizeChanged(int width, int height) { | 330 void WebMediaPlayerAndroid::OnVideoSizeChanged(int width, int height) { |
331 if (natural_size_.width == width && natural_size_.height == height) | 331 if (natural_size_.width == width && natural_size_.height == height) |
332 return; | 332 return; |
333 | 333 |
334 natural_size_.width = width; | 334 natural_size_.width = width; |
335 natural_size_.height = height; | 335 natural_size_.height = height; |
336 if (texture_id_) { | 336 if (texture_id_) { |
337 video_frame_.reset(new WebVideoFrameImpl(VideoFrame::WrapNativeTexture( | 337 video_frame_.reset(new WebVideoFrameImpl(VideoFrame::WrapNativeTexture( |
338 texture_id_, kGLTextureExternalOES, natural_size_, natural_size_, | 338 texture_id_, kGLTextureExternalOES, natural_size_, |
339 base::TimeDelta(), | 339 gfx::Rect(natural_size_), natural_size_, base::TimeDelta(), |
340 VideoFrame::ReadPixelsCB(), | 340 VideoFrame::ReadPixelsCB(), base::Closure()))); |
341 base::Closure()))); | |
342 } | 341 } |
343 } | 342 } |
344 | 343 |
345 void WebMediaPlayerAndroid::UpdateNetworkState( | 344 void WebMediaPlayerAndroid::UpdateNetworkState( |
346 WebMediaPlayer::NetworkState state) { | 345 WebMediaPlayer::NetworkState state) { |
347 network_state_ = state; | 346 network_state_ = state; |
348 client_->networkStateChanged(); | 347 client_->networkStateChanged(); |
349 } | 348 } |
350 | 349 |
351 void WebMediaPlayerAndroid::UpdateReadyState( | 350 void WebMediaPlayerAndroid::UpdateReadyState( |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 411 |
413 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { | 412 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { |
414 needs_establish_peer_ = needs_establish_peer; | 413 needs_establish_peer_ = needs_establish_peer; |
415 } | 414 } |
416 | 415 |
417 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { | 416 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { |
418 is_playing_ = is_playing; | 417 is_playing_ = is_playing; |
419 } | 418 } |
420 | 419 |
421 } // namespace webkit_media | 420 } // namespace webkit_media |
OLD | NEW |