Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: media/base/android/media_player_bridge.cc

Issue 12625005: remove call to get android MediaPlayer class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removing unneeded local javarefs elsewhere Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/android/download_controller_android_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 321
322 GetMetadata(); 322 GetMetadata();
323 323
324 media_prepared_cb_.Run(player_id_, duration_); 324 media_prepared_cb_.Run(player_id_, duration_);
325 } 325 }
326 326
327 void MediaPlayerBridge::GetMetadata() { 327 void MediaPlayerBridge::GetMetadata() {
328 JNIEnv* env = AttachCurrentThread(); 328 JNIEnv* env = AttachCurrentThread();
329 CHECK(env); 329 CHECK(env);
330 330
331 ScopedJavaLocalRef<jclass> media_player_class(
332 GetClass(env, "android/media/MediaPlayer"));
333 jmethodID method = MethodID::Get<MethodID::TYPE_INSTANCE>( 331 jmethodID method = MethodID::Get<MethodID::TYPE_INSTANCE>(
334 env, media_player_class.obj(), "getMetadata", 332 env, g_MediaPlayer_clazz, "getMetadata",
Yaron 2013/03/11 23:13:04 That's not the change I was asking for, but it's a
qinmin 2013/03/12 16:36:24 There is some problem with the metadata class. It
Yaron 2013/03/12 16:50:25 As discussed offline, this could be a sort of cras
qinmin 2013/03/12 19:22:05 Ok, moved the everything to java and return a bool
335 "(ZZ)Landroid/media/Metadata;"); 333 "(ZZ)Landroid/media/Metadata;");
336 ScopedJavaLocalRef<jobject> j_metadata( 334 ScopedJavaLocalRef<jobject> j_metadata(
337 env, env->CallObjectMethod( 335 env, env->CallObjectMethod(
338 j_media_player_.obj(), method, JNI_FALSE, JNI_FALSE)); 336 j_media_player_.obj(), method, JNI_FALSE, JNI_FALSE));
339 CheckException(env); 337 CheckException(env);
340 if (j_metadata.is_null()) 338 if (j_metadata.is_null())
341 return; 339 return;
342 340
343 ScopedJavaLocalRef<jclass> metadata_class( 341 ScopedJavaLocalRef<jclass> metadata_class(
344 GetClass(env, "android/media/Metadata")); 342 GetClass(env, "android/media/Metadata"));
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 384
387 bool MediaPlayerBridge::RegisterMediaPlayerBridge(JNIEnv* env) { 385 bool MediaPlayerBridge::RegisterMediaPlayerBridge(JNIEnv* env) {
388 bool ret = RegisterNativesImpl(env); 386 bool ret = RegisterNativesImpl(env);
389 DCHECK(g_MediaPlayerBridge_clazz); 387 DCHECK(g_MediaPlayerBridge_clazz);
390 if (ret) 388 if (ret)
391 ret = JNI_MediaPlayer::RegisterNativesImpl(env); 389 ret = JNI_MediaPlayer::RegisterNativesImpl(env);
392 return ret; 390 return ret;
393 } 391 }
394 392
395 } // namespace media 393 } // namespace media
OLDNEW
« no previous file with comments | « content/browser/android/download_controller_android_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698