Skip to content

Commit

Permalink
[android] bump minimum API version to 17 and set target API to 21. Al…
Browse files Browse the repository at this point in the history
…so remove any API < 17 checks and obsolete OMXLibName.
  • Loading branch information
MartijnKaijser committed Feb 15, 2015
1 parent e0103cd commit e2ee1f1
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 52 deletions.
2 changes: 1 addition & 1 deletion tools/android/packaging/xbmc/AndroidManifest.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:versionName="@APP_VERSION@" >

<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="14" />
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="21" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down
13 changes: 1 addition & 12 deletions xbmc/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1540,18 +1540,7 @@ bool CApplication::OnSettingUpdate(CSetting* &setting, const char *oldSettingId,
}
#endif
#if defined(TARGET_ANDROID)
if (settingId == "videoplayer.usemediacodec")
{
// Do not permit MediaCodec to be used Android platforms that do not have it.
// The setting will be hidden but the default value is true,
// so change it to false.
if (CAndroidFeatures::GetVersion() < 16)
{
CSettingBool *usemediacodec = (CSettingBool*)setting;
return usemediacodec->SetValue(false);
}
}
else if (settingId == "videoplayer.usestagefright")
if (settingId == "videoplayer.usestagefright")
{
CSettingBool *usestagefright = (CSettingBool*)setting;
return usestagefright->SetValue(false);
Expand Down
20 changes: 0 additions & 20 deletions xbmc/android/activity/AndroidFeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,3 @@ int CAndroidFeatures::GetVersion()
return version;
}

std::string CAndroidFeatures::GetLibiomxName()
{
std::string strOMXLibName;
int version = GetVersion();

// Gingerbread
if (version <= 10)
strOMXLibName = "libiomx-10.so";
// Honeycomb
else if (version <= 13)
strOMXLibName = "libiomx-13.so";
// IceCreamSandwich
else if (version <= 15)
strOMXLibName = "libiomx-14.so";
else
strOMXLibName = "unknown";

return strOMXLibName;
}

1 change: 0 additions & 1 deletion xbmc/android/activity/AndroidFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ class CAndroidFeatures

static bool HasNeon();
static int GetVersion();
static std::string GetLibiomxName();
};
13 changes: 1 addition & 12 deletions xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ class DllLibAmCodec : public DllDynamic, DllLibamCodecInterface
CBitstreamConverter::write_bits(&bs, 32, 0); // CODEC_HANDLE cntl_handle
CBitstreamConverter::write_bits(&bs, 32, 0); // CODEC_HANDLE sub_handle

// added in JellyBean 4.2
if (CAndroidFeatures::GetVersion() > 16)
CBitstreamConverter::write_bits(&bs, 32, 0); // CODEC_HANDLE audio_utils_handle
CBitstreamConverter::write_bits(&bs, 32, 0); // CODEC_HANDLE audio_utils_handle

CBitstreamConverter::write_bits(&bs, 32, p_in->stream_type); // stream_type_t stream_type

Expand All @@ -194,15 +192,6 @@ class DllLibAmCodec : public DllDynamic, DllLibamCodecInterface
CBitstreamConverter::write_bits(&bs, 32, 0); // int vbuf_size
CBitstreamConverter::write_bits(&bs, 32, 0); // int abuf_size

// ARM requires 8-byte alignment for 64-bit members (ratio64)
// and this will force am_sysinfo to be also have 8-byte alignment.
// Since the inclusion of audio_utils_handle for JellyBean 4.2
// 'naturally' aligns am_sysinfo to 8-byte, we need to compensate
// when we are NOT JellyBean 4.2. If these member values get changed,
// then make sure you check that am_sysinfo has 8-byte alignment.
if (CAndroidFeatures::GetVersion() < 17)
CBitstreamConverter::write_bits(&bs, 32, 0);

CBitstreamConverter::write_bits(&bs, 32, p_in->format); // am_sysinfo, unsigned int format
CBitstreamConverter::write_bits(&bs, 32, p_in->width); // am_sysinfo, unsigned int width
CBitstreamConverter::write_bits(&bs, 32, p_in->height); // am_sysinfo, unsigned int height
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,6 @@ CDVDVideoCodecAndroidMediaCodec::~CDVDVideoCodecAndroidMediaCodec()

bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options)
{
// check for 4.1 Jellybean and above.
if (CAndroidFeatures::GetVersion() < 16)
return false;

// mediacodec crashes with null size. Trap this...
if (!hints.width || !hints.height)
{
Expand Down
3 changes: 1 addition & 2 deletions xbmc/settings/SettingConditions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ void CSettingConditions::Initialize()
m_simpleConditions.insert("have_libvdpau");
#endif
#ifdef TARGET_ANDROID
if (CAndroidFeatures::GetVersion() > 15)
m_simpleConditions.insert("has_mediacodec");
m_simpleConditions.insert("has_mediacodec");
#endif
#ifdef HAS_LIBSTAGEFRIGHT
m_simpleConditions.insert("have_libstagefrightdecoder");
Expand Down

0 comments on commit e2ee1f1

Please sign in to comment.