Skip to content

Commit

Permalink
feat(android): add set hevc black list api
Browse files Browse the repository at this point in the history
Signed-off-by: pingkai <pingkai010@gmail.com>
  • Loading branch information
pingkai committed Sep 23, 2020
1 parent 6b3125a commit d5823c4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
5 changes: 5 additions & 0 deletions mediaPlayer/SuperMediaPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3130,6 +3130,11 @@ int SuperMediaPlayer::SetUpVideoPath()
bHW = !(value == "OFF");
break;
}
case AF_CODEC_ID_HEVC: {
string value = getProperty("ro.video.dec.hevc");
bHW = !(value == "OFF");
break;
}

default:
bHW = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ public static enum BlackType {
/****
* H264 hardware decoding.
*/
HW_Decode_H264
HW_Decode_H264,

HW_Decode_HEVC
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,9 +796,19 @@ jstring NativeBase::java_GetSdkVersion(JNIEnv *env, jclass jclazz)
void NativeBase::java_SetBlackType(JNIEnv *env, jclass jclazz, jint type)
{
AF_TRACE;

if (type == 0) { //hw_decode_h264
setProperty("ro.video.dec.h264", "OFF");
const char *key = nullptr;
switch (type) {
case 0://hw_decode_h264
key = "ro.video.dec.h264";
break;
case 1://hw_decode_hevc
key = "ro.video.dec.hevc";
break;
default:
break;
}
if (key != nullptr) {
setProperty(key, "OFF");
}
}

Expand Down

0 comments on commit d5823c4

Please sign in to comment.