MCPcopy Create free account
hub / github.com/RPCSX/rpcsx / cellVdecGetPictureExt

Function cellVdecGetPictureExt

ps3fw/cellVdec.cpp:1369–1548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1367}
1368
1369error_code cellVdecGetPictureExt(ppu_thread& ppu, u32 handle,
1370 vm::cptr<CellVdecPicFormat2> format,
1371 vm::ptr<u8> outBuff, u32 arg4)
1372{
1373 ppu.state += cpu_flag::wait;
1374
1375 cellVdec.trace("cellVdecGetPictureExt(handle=0x%x, format=*0x%x, "
1376 "outBuff=*0x%x, arg4=*0x%x)",
1377 handle, format, outBuff, arg4);
1378
1379 const auto vdec = idm::get_unlocked<vdec_context>(handle);
1380
1381 if (!vdec || !format)
1382 {
1383 return CELL_VDEC_ERROR_ARG;
1384 }
1385
1386 {
1387 std::lock_guard lock{vdec->mutex};
1388
1389 if (vdec->seq_state == sequence_state::closed ||
1390 vdec->seq_state > sequence_state::ending)
1391 {
1392 return {CELL_VDEC_ERROR_SEQ, vdec->seq_state.load()};
1393 }
1394 }
1395
1396 if (format->formatType > 4 ||
1397 (format->formatType <= CELL_VDEC_PICFMT_RGBA32_ILV &&
1398 format->colorMatrixType > CELL_VDEC_COLOR_MATRIX_TYPE_BT709))
1399 {
1400 return CELL_VDEC_ERROR_ARG;
1401 }
1402
1403 if (arg4 && arg4 != 8 && arg4 != 0xc)
1404 {
1405 return CELL_VDEC_ERROR_ARG;
1406 }
1407
1408 if (arg4 || format->unk0 || format->unk1)
1409 {
1410 fmt::throw_exception("cellVdecGetPictureExt: Unknown arguments "
1411 "(arg4=*0x%x, unk0=0x%x, unk1=0x%x)",
1412 arg4, format->unk0, format->unk1);
1413 }
1414
1415 vdec_frame frame;
1416 bool notify = false;
1417 u64 sequence_id{};
1418
1419 {
1420 std::lock_guard lock(vdec->mutex);
1421
1422 if (vdec->out_queue.empty())
1423 {
1424 return CELL_VDEC_ERROR_EMPTY;
1425 }
1426

Callers 1

cellVdecGetPictureFunction · 0.85

Calls 9

throw_exceptionClass · 0.85
av_error_to_stringFunction · 0.85
errorMethod · 0.80
loadMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
resetMethod · 0.45
getMethod · 0.45
get_ptrMethod · 0.45

Tested by

no test coverage detected