fix[kmpp]: Fix channel dup issue

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I20ab644d04156987881ce9c8d384de004b2f4c61
This commit is contained in:
Yandong Lin 2025-03-10 15:06:42 +08:00 committed by Herman Chen
parent 4ed4105a3c
commit 2f2e5f5c3e

View file

@ -129,6 +129,7 @@ static MPP_RET init(Kmpp *ctx, MppCtxType type, MppCodingType coding)
hnd = kmpp_obj_get_hnd(ctx->mVencInitKcfg);
size = kmpp_obj_get_hnd_size(ctx->mVencInitKcfg);
kmpp_obj_get_u32(ctx->mVencInitKcfg, "chan_dup", &ctx->mChanDup);
ret = mpp_vcodec_ioctl(ctx->mClientFd, VCODEC_CHAN_CREATE, 0, size, hnd);
if (ret) {
@ -136,10 +137,12 @@ static MPP_RET init(Kmpp *ctx, MppCtxType type, MppCodingType coding)
return ret;
}
ret = mpp_vcodec_ioctl(ctx->mClientFd, VCODEC_CHAN_START, 0, 0, 0);
if (ret) {
mpp_err("chan %d VCODEC_CHAN_START failed\n", ctx->mChanId);
return ret;
if (!ctx->mChanDup) {
ret = mpp_vcodec_ioctl(ctx->mClientFd, VCODEC_CHAN_START, 0, 0, 0);
if (ret) {
mpp_err("chan %d VCODEC_CHAN_START failed\n", ctx->mChanId);
return ret;
}
}
if (ctx->mPacketGroup == NULL)