mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-11-05 13:20:11 +00:00
ResetDecoder, SetDecodeInput, SyncDecode, GetDecodeOutput, FlushDecodeOutput, SyncDecodeWptr, TrySyncDecode and TrySyncDecodeWptr follow shadPS4's vdeccore.cpp. CreateDecoder starts a decode thread of the decoder's own that takes packet, flush and reset commands in order and decodes with the FFmpeg context it opens, and DeleteDecoder stops and joins it and frees what is still queued. GetDecodeOutput converts a picture to NV12 and copies it, as shadPS4's CopyNV12Data does, to the caller's frame buffer, else the next mapped slot, else a fallback buffer the decoder owns, writes the hardware picture info at the end of the frame buffer and fills the output info as shadPS4 does. The six exports that are stubs in shadPS4 stay unknown. The tests decode the H.264 fixture into slots, a caller buffer and the fallback, compare the visible picture with libSceVideodec2's decode of it, and cover every argument error, the empty queue, an invalid pts, flush, reset, try-sync, the write-pointer forwards and a delete with queued input.