提交 779348c5 编写于 作者: Z Zhang Rui

android/sample: show vdec_type

上级 b946b9e3
......@@ -708,6 +708,10 @@ public final class IjkMediaPlayer extends AbstractMediaPlayer {
private native int _getLoopCount();
public int getVideoDecoder() {
return (int)_getPropertyLong(FFP_PROP_INT64_VIDEO_DECODER, FFP_PROPV_DECODER_UNKNOWN);
}
public float getVideoOutputFramesPerSecond() {
return _getPropertyFloat(PROP_FLOAT_VIDEO_OUTPUT_FRAMES_PER_SECOND, 0.0f);
}
......
......@@ -72,6 +72,19 @@ public class InfoHudViewHolder {
if (mp == null)
break;
int vdec = mp.getVideoDecoder();
switch (vdec) {
case IjkMediaPlayer.FFP_PROPV_DECODER_AVCODEC:
setRowValue(R.string.vdec, "avcodec");
break;
case IjkMediaPlayer.FFP_PROPV_DECODER_MEDIACODEC:
setRowValue(R.string.vdec, "MediaCodec");
break;
default:
setRowValue(R.string.vdec, "");
break;
}
float fpsOutput = mp.getVideoOutputFramesPerSecond();
float fpsDecode = mp.getVideoDecodeFramesPerSecond();
setRowValue(R.string.fps, String.format(Locale.US, "%.2f / %.2f", fpsDecode, fpsOutput));
......
......@@ -14,6 +14,7 @@
<string name="toggle_render">Render</string>
<string name="toggle_ratio">Scale</string>
<string name="show_info">Info</string>
<string name="vdec">vdec</string>
<string name="fps">fps</string>
<string name="v_cache">v-cache</string>
<string name="a_cache">a-cache</string>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册