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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 } | 269 } |
270 | 270 |
271 int MediaPlayerBridge::GetVideoHeight() { | 271 int MediaPlayerBridge::GetVideoHeight() { |
272 if (!prepared_) | 272 if (!prepared_) |
273 return height_; | 273 return height_; |
274 JNIEnv* env = base::android::AttachCurrentThread(); | 274 JNIEnv* env = base::android::AttachCurrentThread(); |
275 return Java_MediaPlayerBridge_getVideoHeight( | 275 return Java_MediaPlayerBridge_getVideoHeight( |
276 env, j_media_player_bridge_.obj()); | 276 env, j_media_player_bridge_.obj()); |
277 } | 277 } |
278 | 278 |
279 void MediaPlayerBridge::SeekTo(const base::TimeDelta& timestamp) { | 279 void MediaPlayerBridge::SeekTo(base::TimeDelta timestamp) { |
280 // Record the time to seek when OnMediaPrepared() is called. | 280 // Record the time to seek when OnMediaPrepared() is called. |
281 pending_seek_ = timestamp; | 281 pending_seek_ = timestamp; |
282 | 282 |
283 if (j_media_player_bridge_.is_null()) | 283 if (j_media_player_bridge_.is_null()) |
284 Prepare(); | 284 Prepare(); |
285 else if (prepared_) | 285 else if (prepared_) |
286 SeekInternal(timestamp); | 286 SeekInternal(timestamp); |
287 } | 287 } |
288 | 288 |
289 base::TimeDelta MediaPlayerBridge::GetCurrentTime() { | 289 base::TimeDelta MediaPlayerBridge::GetCurrentTime() { |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 | 473 |
474 GURL MediaPlayerBridge::GetFirstPartyForCookies() { | 474 GURL MediaPlayerBridge::GetFirstPartyForCookies() { |
475 return first_party_for_cookies_; | 475 return first_party_for_cookies_; |
476 } | 476 } |
477 | 477 |
478 bool MediaPlayerBridge::IsSurfaceInUse() const { | 478 bool MediaPlayerBridge::IsSurfaceInUse() const { |
479 return is_surface_in_use_; | 479 return is_surface_in_use_; |
480 } | 480 } |
481 | 481 |
482 } // namespace media | 482 } // namespace media |
OLD | NEW |