| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 if (j_media_player_.is_null()) { | 165 if (j_media_player_.is_null()) { |
| 166 pending_play_ = false; | 166 pending_play_ = false; |
| 167 } else { | 167 } else { |
| 168 if (prepared_ && IsPlaying()) | 168 if (prepared_ && IsPlaying()) |
| 169 PauseInternal(); | 169 PauseInternal(); |
| 170 else | 170 else |
| 171 pending_play_ = false; | 171 pending_play_ = false; |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 | 174 |
| 175 | |
| 176 bool MediaPlayerBridge::IsPlaying() { | 175 bool MediaPlayerBridge::IsPlaying() { |
| 177 if (!prepared_) | 176 if (!prepared_) |
| 178 return pending_play_; | 177 return pending_play_; |
| 179 | 178 |
| 180 JNIEnv* env = AttachCurrentThread(); | 179 JNIEnv* env = AttachCurrentThread(); |
| 181 CHECK(env); | 180 CHECK(env); |
| 182 jboolean result = JNI_MediaPlayer::Java_MediaPlayer_isPlaying( | 181 jboolean result = JNI_MediaPlayer::Java_MediaPlayer_isPlaying( |
| 183 env, j_media_player_.obj()); | 182 env, j_media_player_.obj()); |
| 184 return result; | 183 return result; |
| 185 } | 184 } |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 374 |
| 376 bool MediaPlayerBridge::RegisterMediaPlayerBridge(JNIEnv* env) { | 375 bool MediaPlayerBridge::RegisterMediaPlayerBridge(JNIEnv* env) { |
| 377 bool ret = RegisterNativesImpl(env); | 376 bool ret = RegisterNativesImpl(env); |
| 378 DCHECK(g_MediaPlayerBridge_clazz); | 377 DCHECK(g_MediaPlayerBridge_clazz); |
| 379 if (ret) | 378 if (ret) |
| 380 ret = JNI_MediaPlayer::RegisterNativesImpl(env); | 379 ret = JNI_MediaPlayer::RegisterNativesImpl(env); |
| 381 return ret; | 380 return ret; |
| 382 } | 381 } |
| 383 | 382 |
| 384 } // namespace media | 383 } // namespace media |
| OLD | NEW |