Skip to content

Commit 9c2eccc

Browse files
committed
调整ijkplayer参数
1 parent fc02beb commit 9c2eccc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sdkdemo/src/main/java/com/tencent/iot/explorer/link/demo/video/preview/VideoTestActivity.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,18 +461,20 @@ class VideoTestActivity : VideoBaseActivity(), XP2PCallback, CoroutineScope by M
461461
player.setOnInfoListener(this@VideoTestActivity)
462462
player.let {
463463
val url = urlPrefix + suffix
464-
it.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "probesize", 50 * 1024)
464+
it.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "probesize", 25 * 1024)
465465
it.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "packet-buffering", 0)
466466
it.setOption(IjkMediaPlayer.OPT_CATEGORY_CODEC, "threads", 2)
467-
// it.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "max-buffer-size", 30*1024)
468467
it.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "start-on-prepared", 1)
469468
it.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "sync-av-start", 0)
469+
it.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "min-frames", 5)
470+
it.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "max-buffer-size", 512 * 1024)
470471
it.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec", 1)
471472
it.setOption(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-auto-rotate", 1)
472473
it.setOption(
473474
IjkMediaPlayer.OPT_CATEGORY_PLAYER, "mediacodec-handle-resolution-change", 1
474475
)
475-
it.setFrameSpeed(1.8f)
476+
it.setFrameSpeed(1.5f)
477+
it.setMaxPacketNum(2)
476478
while (!::surface.isInitialized) {
477479
delay(50)
478480
L.e("delay for waiting surface.")

0 commit comments

Comments
 (0)