| 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 "media/base/android/media_player_bridge.h" | 5 #include "media/base/android/media_player_bridge.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } | 260 } |
| 261 | 261 |
| 262 int MediaPlayerBridge::GetVideoHeight() { | 262 int MediaPlayerBridge::GetVideoHeight() { |
| 263 if (!prepared_) | 263 if (!prepared_) |
| 264 return height_; | 264 return height_; |
| 265 JNIEnv* env = base::android::AttachCurrentThread(); | 265 JNIEnv* env = base::android::AttachCurrentThread(); |
| 266 return Java_MediaPlayerBridge_getVideoHeight( | 266 return Java_MediaPlayerBridge_getVideoHeight( |
| 267 env, j_media_player_bridge_.obj()); | 267 env, j_media_player_bridge_.obj()); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void MediaPlayerBridge::SeekTo(const base::TimeDelta& timestamp) { | 270 void MediaPlayerBridge::SeekTo(base::TimeDelta timestamp) { |
| 271 // Record the time to seek when OnMediaPrepared() is called. | 271 // Record the time to seek when OnMediaPrepared() is called. |
| 272 pending_seek_ = timestamp; | 272 pending_seek_ = timestamp; |
| 273 | 273 |
| 274 if (j_media_player_bridge_.is_null()) | 274 if (j_media_player_bridge_.is_null()) |
| 275 Prepare(); | 275 Prepare(); |
| 276 else if (prepared_) | 276 else if (prepared_) |
| 277 SeekInternal(timestamp); | 277 SeekInternal(timestamp); |
| 278 } | 278 } |
| 279 | 279 |
| 280 base::TimeDelta MediaPlayerBridge::GetCurrentTime() { | 280 base::TimeDelta MediaPlayerBridge::GetCurrentTime() { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 | 464 |
| 465 GURL MediaPlayerBridge::GetFirstPartyForCookies() { | 465 GURL MediaPlayerBridge::GetFirstPartyForCookies() { |
| 466 return first_party_for_cookies_; | 466 return first_party_for_cookies_; |
| 467 } | 467 } |
| 468 | 468 |
| 469 bool MediaPlayerBridge::IsSurfaceInUse() const { | 469 bool MediaPlayerBridge::IsSurfaceInUse() const { |
| 470 return is_surface_in_use_; | 470 return is_surface_in_use_; |
| 471 } | 471 } |
| 472 | 472 |
| 473 } // namespace media | 473 } // namespace media |
| OLD | NEW |