cellVdec: Adjust for reservations

This commit is contained in:
Eladash 2022-09-07 11:19:56 +03:00 committed by Ivan
parent 7698064f5a
commit 89e0dcba5e
1 changed files with 25 additions and 10 deletions

View File

@ -563,9 +563,10 @@ struct vdec_context final
break;
}
}
thread_ctrl::wait_for(1000);
if (elapsed++ >= 5000) // 5 seconds
thread_ctrl::wait_for(10000);
if (elapsed++ >= 500) // 5 seconds
{
cellVdec.error("Video au decode has been waiting for a consumer for 5 seconds. (handle=0x%x, seq_id=%d, cmd_id=%d, queue_size=%d)", handle, cmd->seq_id, cmd->id, out_queue.size());
elapsed = 0;
@ -997,8 +998,10 @@ error_code cellVdecClose(ppu_thread& ppu, u32 handle)
return CELL_OK;
}
error_code cellVdecStartSeq(u32 handle)
error_code cellVdecStartSeq(ppu_thread& ppu, u32 handle)
{
ppu.state += cpu_flag::wait;
cellVdec.warning("cellVdecStartSeq(handle=0x%x)", handle);
const auto vdec = idm::get<vdec_context>(handle);
@ -1047,8 +1050,10 @@ error_code cellVdecStartSeq(u32 handle)
return CELL_OK;
}
error_code cellVdecEndSeq(u32 handle)
error_code cellVdecEndSeq(ppu_thread& ppu, u32 handle)
{
ppu.state += cpu_flag::wait;
cellVdec.warning("cellVdecEndSeq(handle=0x%x)", handle);
const auto vdec = idm::get<vdec_context>(handle);
@ -1078,8 +1083,10 @@ error_code cellVdecEndSeq(u32 handle)
return CELL_OK;
}
error_code cellVdecDecodeAu(u32 handle, CellVdecDecodeMode mode, vm::cptr<CellVdecAuInfo> auInfo)
error_code cellVdecDecodeAu(ppu_thread& ppu, u32 handle, CellVdecDecodeMode mode, vm::cptr<CellVdecAuInfo> auInfo)
{
ppu.state += cpu_flag::wait;
cellVdec.trace("cellVdecDecodeAu(handle=0x%x, mode=%d, auInfo=*0x%x)", handle, +mode, auInfo);
const auto vdec = idm::get<vdec_context>(handle);
@ -1124,8 +1131,10 @@ error_code cellVdecDecodeAu(u32 handle, CellVdecDecodeMode mode, vm::cptr<CellVd
return CELL_OK;
}
error_code cellVdecDecodeAuEx2(u32 handle, CellVdecDecodeMode mode, vm::cptr<CellVdecAuInfoEx2> auInfo)
error_code cellVdecDecodeAuEx2(ppu_thread& ppu, u32 handle, CellVdecDecodeMode mode, vm::cptr<CellVdecAuInfoEx2> auInfo)
{
ppu.state += cpu_flag::wait;
cellVdec.todo("cellVdecDecodeAuEx2(handle=0x%x, mode=%d, auInfo=*0x%x)", handle, +mode, auInfo);
const auto vdec = idm::get<vdec_context>(handle);
@ -1178,8 +1187,10 @@ error_code cellVdecDecodeAuEx2(u32 handle, CellVdecDecodeMode mode, vm::cptr<Cel
return CELL_OK;
}
error_code cellVdecGetPictureExt(u32 handle, vm::cptr<CellVdecPicFormat2> format, vm::ptr<u8> outBuff, u32 arg4)
error_code cellVdecGetPictureExt(ppu_thread& ppu, u32 handle, vm::cptr<CellVdecPicFormat2> format, vm::ptr<u8> outBuff, u32 arg4)
{
ppu.state += cpu_flag::wait;
cellVdec.trace("cellVdecGetPictureExt(handle=0x%x, format=*0x%x, outBuff=*0x%x, arg4=*0x%x)", handle, format, outBuff, arg4);
const auto vdec = idm::get<vdec_context>(handle);
@ -1323,8 +1334,10 @@ error_code cellVdecGetPictureExt(u32 handle, vm::cptr<CellVdecPicFormat2> format
return CELL_OK;
}
error_code cellVdecGetPicture(u32 handle, vm::cptr<CellVdecPicFormat> format, vm::ptr<u8> outBuff)
error_code cellVdecGetPicture(ppu_thread& ppu, u32 handle, vm::cptr<CellVdecPicFormat> format, vm::ptr<u8> outBuff)
{
ppu.state += cpu_flag::wait;
cellVdec.trace("cellVdecGetPicture(handle=0x%x, format=*0x%x, outBuff=*0x%x)", handle, format, outBuff);
if (!format)
@ -1339,11 +1352,13 @@ error_code cellVdecGetPicture(u32 handle, vm::cptr<CellVdecPicFormat> format, vm
format2->unk0 = 0;
format2->unk1 = 0;
return cellVdecGetPictureExt(handle, format2, outBuff, 0);
return cellVdecGetPictureExt(ppu, handle, format2, outBuff, 0);
}
error_code cellVdecGetPicItem(u32 handle, vm::pptr<CellVdecPicItem> picItem)
error_code cellVdecGetPicItem(ppu_thread& ppu, u32 handle, vm::pptr<CellVdecPicItem> picItem)
{
ppu.state += cpu_flag::wait;
cellVdec.trace("cellVdecGetPicItem(handle=0x%x, picItem=**0x%x)", handle, picItem);
const auto vdec = idm::get<vdec_context>(handle);