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

Side by Side Diff: media/base/media_android.cc

Issue 13949012: Need to call RegisterJni for testing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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
« no previous file with comments | « build/common.gypi ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/media.h" 5 #include "media/base/media.h"
6 6
7 #include <cpu-features.h> 7 #include <cpu-features.h>
8 8
9 #include "base/android/jni_android.h"
9 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "media/base/android/media_jni_registrar.h"
10 12
11 namespace media { 13 namespace media {
12 14
13 // Caches the result of the check for NEON support. 15 // Caches the result of the check for NEON support.
14 static bool g_media_library_is_initialized = false; 16 static bool g_media_library_is_initialized = false;
15 17
16 bool InitializeMediaLibrary(const base::FilePath& module_dir) { 18 bool InitializeMediaLibrary(const base::FilePath& module_dir) {
17 // No real initialization is necessary but we do need to check if 19 // No real initialization is necessary but we do need to check if
18 // Neon is supported because the FFT library requires Neon. 20 // Neon is supported because the FFT library requires Neon.
19 g_media_library_is_initialized = (android_getCpuFeatures() & 21 g_media_library_is_initialized = (android_getCpuFeatures() &
20 ANDROID_CPU_ARM_FEATURE_NEON) != 0; 22 ANDROID_CPU_ARM_FEATURE_NEON) != 0;
21 return g_media_library_is_initialized; 23 return g_media_library_is_initialized;
22 } 24 }
23 25
24 void InitializeMediaLibraryForTesting() { 26 void InitializeMediaLibraryForTesting() {
27 // Register JNI bindings for android.
28 JNIEnv* env = base::android::AttachCurrentThread();
29 RegisterJni(env);
25 } 30 }
26 31
27 bool IsMediaLibraryInitialized() { 32 bool IsMediaLibraryInitialized() {
28 return g_media_library_is_initialized; 33 return g_media_library_is_initialized;
29 } 34 }
30 35
31 } // namespace media 36 } // namespace media
OLDNEW
« no previous file with comments | « build/common.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698