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" |
11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
13 #include "jni/MediaPlayerBridge_jni.h" | 13 #include "jni/MediaPlayerBridge_jni.h" |
14 #include "jni/MediaPlayer_jni.h" | 14 #include "jni/MediaPlayer_jni.h" |
15 #include "media/base/android/cookie_getter.h" | 15 #include "media/base/android/cookie_getter.h" |
16 #include "media/base/android/media_player_bridge_manager.h" | 16 #include "media/base/android/media_player_bridge_manager.h" |
17 | 17 |
18 using base::android::AttachCurrentThread; | 18 using base::android::AttachCurrentThread; |
19 using base::android::CheckException; | 19 using base::android::CheckException; |
20 using base::android::ConvertUTF8ToJavaString; | 20 using base::android::ConvertUTF8ToJavaString; |
21 using base::android::GetClass; | 21 using base::android::GetClass; |
| 22 using base::android::JavaRef; |
22 using base::android::MethodID; | 23 using base::android::MethodID; |
23 using base::android::JavaRef; | |
24 using base::android::ScopedJavaLocalRef; | 24 using base::android::ScopedJavaLocalRef; |
25 | 25 |
26 // These constants are from the android source tree and need to be kept in | 26 // These constants are from the android source tree and need to be kept in |
27 // sync with android/media/MediaMetadata.java. | 27 // sync with android/media/MediaMetadata.java. |
28 static const jint kPauseAvailable = 1; | 28 static const jint kPauseAvailable = 1; |
29 static const jint kSeekBackwardAvailable = 2; | 29 static const jint kSeekBackwardAvailable = 2; |
30 static const jint kSeekForwardAvailable = 3; | 30 static const jint kSeekForwardAvailable = 3; |
31 | 31 |
32 // Time update happens every 250ms. | 32 // Time update happens every 250ms. |
33 static const int kTimeUpdateInterval = 250; | 33 static const int kTimeUpdateInterval = 250; |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 | 374 |
375 bool MediaPlayerBridge::RegisterMediaPlayerBridge(JNIEnv* env) { | 375 bool MediaPlayerBridge::RegisterMediaPlayerBridge(JNIEnv* env) { |
376 bool ret = RegisterNativesImpl(env); | 376 bool ret = RegisterNativesImpl(env); |
377 DCHECK(g_MediaPlayerBridge_clazz); | 377 DCHECK(g_MediaPlayerBridge_clazz); |
378 if (ret) | 378 if (ret) |
379 ret = JNI_MediaPlayer::RegisterNativesImpl(env); | 379 ret = JNI_MediaPlayer::RegisterNativesImpl(env); |
380 return ret; | 380 return ret; |
381 } | 381 } |
382 | 382 |
383 } // namespace media | 383 } // namespace media |
OLD | NEW |