| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 if (manager_) | 369 if (manager_) |
| 370 manager_->UnregisterMediaPlayer(player_id_); | 370 manager_->UnregisterMediaPlayer(player_id_); |
| 371 | 371 |
| 372 manager_ = NULL; | 372 manager_ = NULL; |
| 373 main_loop_ = NULL; | 373 main_loop_ = NULL; |
| 374 } | 374 } |
| 375 | 375 |
| 376 void WebMediaPlayerAndroid::ReallocateVideoFrame() { | 376 void WebMediaPlayerAndroid::ReallocateVideoFrame() { |
| 377 if (texture_id_) { | 377 if (texture_id_) { |
| 378 video_frame_.reset(new WebVideoFrameImpl(VideoFrame::WrapNativeTexture( | 378 video_frame_.reset(new WebVideoFrameImpl(VideoFrame::WrapNativeTexture( |
| 379 texture_id_, kGLTextureExternalOES, natural_size_, natural_size_, | 379 texture_id_, kGLTextureExternalOES, natural_size_, |
| 380 base::TimeDelta(), | 380 gfx::Rect(natural_size_), natural_size_, base::TimeDelta(), |
| 381 VideoFrame::ReadPixelsCB(), | 381 VideoFrame::ReadPixelsCB(), |
| 382 base::Closure()))); | 382 base::Closure()))); |
| 383 } | 383 } |
| 384 } | 384 } |
| 385 | 385 |
| 386 WebVideoFrame* WebMediaPlayerAndroid::getCurrentFrame() { | 386 WebVideoFrame* WebMediaPlayerAndroid::getCurrentFrame() { |
| 387 if (stream_texture_proxy_.get() && !stream_texture_proxy_->IsInitialized() | 387 if (stream_texture_proxy_.get() && !stream_texture_proxy_->IsInitialized() |
| 388 && stream_id_) { | 388 && stream_id_) { |
| 389 stream_texture_proxy_->Initialize( | 389 stream_texture_proxy_->Initialize( |
| 390 stream_id_, video_frame_->width(), video_frame_->height()); | 390 stream_id_, video_frame_->width(), video_frame_->height()); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 411 | 411 |
| 412 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { | 412 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { |
| 413 needs_establish_peer_ = needs_establish_peer; | 413 needs_establish_peer_ = needs_establish_peer; |
| 414 } | 414 } |
| 415 | 415 |
| 416 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { | 416 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { |
| 417 is_playing_ = is_playing; | 417 is_playing_ = is_playing; |
| 418 } | 418 } |
| 419 | 419 |
| 420 } // namespace webkit_media | 420 } // namespace webkit_media |
| OLD | NEW |