Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request xbmc#24926 from neo1973/fix_24850
[Android TV] fixed cover display for channels
- Loading branch information
Showing
7 changed files
with
150 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package @APP_PACKAGE@; | ||
|
||
import android.util.Log; | ||
|
||
/** | ||
* Created by Maven85 on 16/03/2020. | ||
*/ | ||
|
||
public class XBMCTextureCache | ||
{ | ||
native String _unwrapImageURL(String image); | ||
|
||
private static final String TAG = "@APP_NAME@"; | ||
|
||
public XBMCTextureCache() | ||
{ | ||
} | ||
|
||
public String unwrapImageURL(String image) | ||
{ | ||
try | ||
{ | ||
return _unwrapImageURL(image); | ||
} | ||
catch (Exception e) | ||
{ | ||
Log.e(TAG, "unwrapImageURL: Exception: " + e.getMessage()); | ||
return null; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (C) 2020 Team Kodi | ||
* This file is part of Kodi - https://kodi.tv | ||
* | ||
* SPDX-License-Identifier: GPL-2.0-or-later | ||
* See LICENSES/README.md for more information. | ||
*/ | ||
|
||
#include "JNIXBMCTextureCache.h" | ||
|
||
#include "CompileInfo.h" | ||
#include "TextureCache.h" | ||
|
||
#include <androidjni/Context.h> | ||
#include <androidjni/jutils-details.hpp> | ||
|
||
using namespace jni; | ||
|
||
static std::string s_className = std::string(CCompileInfo::GetClass()) + "/XBMCTextureCache"; | ||
|
||
void CJNIXBMCTextureCache::RegisterNatives(JNIEnv* env) | ||
{ | ||
jclass cClass = env->FindClass(s_className.c_str()); | ||
if (cClass) | ||
{ | ||
JNINativeMethod methods[] = { | ||
{"_unwrapImageURL", "(Ljava/lang/String;)Ljava/lang/String;", | ||
(void*)&CJNIXBMCTextureCache::_unwrapImageURL}, | ||
}; | ||
|
||
env->RegisterNatives(cClass, methods, sizeof(methods) / sizeof(methods[0])); | ||
} | ||
} | ||
|
||
jstring CJNIXBMCTextureCache::_unwrapImageURL(JNIEnv* env, jobject thiz, jstring image) | ||
{ | ||
std::string strImage = jcast<std::string>(jhstring::fromJNI(image)); | ||
std::string responseData = CTextureUtils::UnwrapImageURL(strImage); | ||
|
||
jstring jres = env->NewStringUTF(responseData.c_str()); | ||
return jres; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (C) 2020 Team Kodi | ||
* This file is part of Kodi - https://kodi.tv | ||
* | ||
* SPDX-License-Identifier: GPL-2.0-or-later | ||
* See LICENSES/README.md for more information. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <androidjni/JNIBase.h> | ||
|
||
namespace jni | ||
{ | ||
|
||
class CJNIXBMCTextureCache : public CJNIBase | ||
{ | ||
public: | ||
CJNIXBMCTextureCache(const jni::jhobject& object) : CJNIBase(object) {} | ||
|
||
static void RegisterNatives(JNIEnv* env); | ||
|
||
protected: | ||
~CJNIXBMCTextureCache() override = default; | ||
|
||
static jstring _unwrapImageURL(JNIEnv* env, jobject thiz, jstring image); | ||
}; | ||
|
||
} // namespace jni |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters