| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 jmethodID method = GetMethodID(env, | 69 jmethodID method = GetMethodID(env, |
| 70 j_media_player_class_, | 70 j_media_player_class_, |
| 71 method_name.c_str(), | 71 method_name.c_str(), |
| 72 signature.c_str()); | 72 signature.c_str()); |
| 73 env->CallVoidMethod(j_media_player_.obj(), method, j_listener.obj()); | 73 env->CallVoidMethod(j_media_player_.obj(), method, j_listener.obj()); |
| 74 CheckException(env); | 74 CheckException(env); |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 MediaPlayerBridge::~MediaPlayerBridge() { | 78 MediaPlayerBridge::~MediaPlayerBridge() { |
| 79 SetVideoSurface(NULL); |
| 79 CallVoidMethod("release"); | 80 CallVoidMethod("release"); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void MediaPlayerBridge::SetDataSource( | 83 void MediaPlayerBridge::SetDataSource( |
| 83 const std::string& url, | 84 const std::string& url, |
| 84 const std::string& cookies, | 85 const std::string& cookies, |
| 85 bool hide_url_log) { | 86 bool hide_url_log) { |
| 86 JNIEnv* env = AttachCurrentThread(); | 87 JNIEnv* env = AttachCurrentThread(); |
| 87 CHECK(env); | 88 CHECK(env); |
| 88 | 89 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 return j_result; | 352 return j_result; |
| 352 } | 353 } |
| 353 | 354 |
| 354 bool MediaPlayerBridge::RegisterMediaPlayerListener(JNIEnv* env) { | 355 bool MediaPlayerBridge::RegisterMediaPlayerListener(JNIEnv* env) { |
| 355 bool ret = RegisterNativesImpl(env); | 356 bool ret = RegisterNativesImpl(env); |
| 356 DCHECK(g_MediaPlayerListener_clazz); | 357 DCHECK(g_MediaPlayerListener_clazz); |
| 357 return ret; | 358 return ret; |
| 358 } | 359 } |
| 359 | 360 |
| 360 } // namespace media | 361 } // namespace media |
| OLD | NEW |