Change file path to make it work on android
BUG= TEST=try bots Review URL: https://webrtc-codereview.appspot.com/672007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2471 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
8d59e70434
commit
fb59442c40
@ -39,7 +39,11 @@ static const char* kPathDelimiter = "/";
|
|||||||
static const char* kProjectRootFileName = "DEPS";
|
static const char* kProjectRootFileName = "DEPS";
|
||||||
static const char* kOutputDirName = "out";
|
static const char* kOutputDirName = "out";
|
||||||
static const char* kFallbackPath = "./";
|
static const char* kFallbackPath = "./";
|
||||||
|
#ifdef WEBRTC_ANDROID
|
||||||
|
static const char* kResourcesDirName = "/sdcard/";
|
||||||
|
#else
|
||||||
static const char* kResourcesDirName = "resources";
|
static const char* kResourcesDirName = "resources";
|
||||||
|
#endif
|
||||||
const char* kCannotFindProjectRootDir = "ERROR_CANNOT_FIND_PROJECT_ROOT_DIR";
|
const char* kCannotFindProjectRootDir = "ERROR_CANNOT_FIND_PROJECT_ROOT_DIR";
|
||||||
|
|
||||||
std::string ProjectRootPath() {
|
std::string ProjectRootPath() {
|
||||||
@ -142,6 +146,9 @@ std::string ResourcePath(std::string name, std::string extension) {
|
|||||||
std::string architecture = "32";
|
std::string architecture = "32";
|
||||||
#endif // WEBRTC_ARCH_64_BITS
|
#endif // WEBRTC_ARCH_64_BITS
|
||||||
|
|
||||||
|
#ifdef WEBRTC_ANDROID
|
||||||
|
std::string resources_path = kResourcesDirName;
|
||||||
|
#else
|
||||||
std::string resources_path = ProjectRootPath() + kResourcesDirName +
|
std::string resources_path = ProjectRootPath() + kResourcesDirName +
|
||||||
kPathDelimiter;
|
kPathDelimiter;
|
||||||
std::string resource_file = resources_path + name + "_" + platform + "_" +
|
std::string resource_file = resources_path + name + "_" + platform + "_" +
|
||||||
@ -159,6 +166,7 @@ std::string ResourcePath(std::string name, std::string extension) {
|
|||||||
if (FileExists(resource_file)) {
|
if (FileExists(resource_file)) {
|
||||||
return resource_file;
|
return resource_file;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
// Fall back on name without architecture or platform.
|
// Fall back on name without architecture or platform.
|
||||||
return resources_path + name + "." + extension;
|
return resources_path + name + "." + extension;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user