mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-01-31 00:55:19 +01:00
Lib.Videodec2: Stub sceVideodec2AllocateComputeQueue to return a valid computeQueue pointer. (#3915)
* Stub compute queue output to cpuGpuMemory * Rename namespace This has bugged me for far too long * Oops
This commit is contained in:
@@ -120,13 +120,13 @@ void InitHLELibs(Core::Loader::SymbolsResolver* sym) {
|
||||
Libraries::ErrorDialog::RegisterLib(sym);
|
||||
Libraries::ImeDialog::RegisterLib(sym);
|
||||
Libraries::AvPlayer::RegisterLib(sym);
|
||||
Libraries::Vdec2::RegisterLib(sym);
|
||||
Libraries::Videodec::RegisterLib(sym);
|
||||
Libraries::Videodec2::RegisterLib(sym);
|
||||
Libraries::Audio3d::RegisterLib(sym);
|
||||
Libraries::Ime::RegisterLib(sym);
|
||||
Libraries::GameLiveStreaming::RegisterLib(sym);
|
||||
Libraries::SharePlay::RegisterLib(sym);
|
||||
Libraries::Remoteplay::RegisterLib(sym);
|
||||
Libraries::Videodec::RegisterLib(sym);
|
||||
Libraries::RazorCpu::RegisterLib(sym);
|
||||
Libraries::Move::RegisterLib(sym);
|
||||
Libraries::Fiber::RegisterLib(sym);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "core/libraries/videodec/videodec2_impl.h"
|
||||
#include "core/libraries/videodec/videodec_error.h"
|
||||
|
||||
namespace Libraries::Vdec2 {
|
||||
namespace Libraries::Videodec2 {
|
||||
|
||||
static constexpr u64 kMinimumMemorySize = 16_MB; ///> Fake minimum memory size for querying
|
||||
|
||||
@@ -34,7 +34,35 @@ s32 PS4_SYSV_ABI
|
||||
sceVideodec2AllocateComputeQueue(const OrbisVideodec2ComputeConfigInfo* computeCfgInfo,
|
||||
const OrbisVideodec2ComputeMemoryInfo* computeMemInfo,
|
||||
OrbisVideodec2ComputeQueue* computeQueue) {
|
||||
LOG_INFO(Lib_Vdec2, "called");
|
||||
LOG_WARNING(Lib_Vdec2, "called");
|
||||
if (!computeCfgInfo || !computeMemInfo || !computeQueue) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid arguments");
|
||||
return ORBIS_VIDEODEC2_ERROR_ARGUMENT_POINTER;
|
||||
}
|
||||
if (computeCfgInfo->thisSize != sizeof(OrbisVideodec2ComputeConfigInfo) ||
|
||||
computeMemInfo->thisSize != sizeof(OrbisVideodec2ComputeMemoryInfo)) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid struct size");
|
||||
return ORBIS_VIDEODEC2_ERROR_STRUCT_SIZE;
|
||||
}
|
||||
if (computeCfgInfo->reserved0 != 0 || computeCfgInfo->reserved1 != 0) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid compute config");
|
||||
return ORBIS_VIDEODEC2_ERROR_CONFIG_INFO;
|
||||
}
|
||||
if (computeCfgInfo->computePipeId > 4) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid compute pipe id");
|
||||
return ORBIS_VIDEODEC2_ERROR_COMPUTE_PIPE_ID;
|
||||
}
|
||||
if (computeCfgInfo->computeQueueId > 7) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid compute queue id");
|
||||
return ORBIS_VIDEODEC2_ERROR_COMPUTE_QUEUE_ID;
|
||||
}
|
||||
if (!computeMemInfo->cpuGpuMemory) {
|
||||
LOG_ERROR(Lib_Vdec2, "Invalid memory pointer");
|
||||
return ORBIS_VIDEODEC2_ERROR_MEMORY_POINTER;
|
||||
}
|
||||
|
||||
// The real library returns a pointer to memory inside cpuGpuMemory
|
||||
*computeQueue = computeMemInfo->cpuGpuMemory;
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
@@ -233,4 +261,4 @@ void RegisterLib(Core::Loader::SymbolsResolver* sym) {
|
||||
sceVideodec2GetPictureInfo);
|
||||
}
|
||||
|
||||
} // namespace Libraries::Vdec2
|
||||
} // namespace Libraries::Videodec2
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
namespace Core::Loader {
|
||||
class SymbolsResolver;
|
||||
}
|
||||
namespace Libraries::Vdec2 {
|
||||
namespace Libraries::Videodec2 {
|
||||
|
||||
class VdecDecoder;
|
||||
|
||||
@@ -138,4 +138,4 @@ s32 PS4_SYSV_ABI sceVideodec2GetPictureInfo(const OrbisVideodec2OutputInfo* outp
|
||||
void* p1stPictureInfo, void* p2ndPictureInfo);
|
||||
|
||||
void RegisterLib(Core::Loader::SymbolsResolver* sym);
|
||||
} // namespace Libraries::Vdec2
|
||||
} // namespace Libraries::Videodec2
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "common/types.h"
|
||||
|
||||
namespace Libraries::Vdec2 {
|
||||
namespace Libraries::Videodec2 {
|
||||
|
||||
struct OrbisVideodec2AvcPictureInfo {
|
||||
u64 thisSize;
|
||||
@@ -127,4 +127,4 @@ struct OrbisVideodec2LegacyAvcPictureInfo {
|
||||
};
|
||||
static_assert(sizeof(OrbisVideodec2LegacyAvcPictureInfo) == 0x68);
|
||||
|
||||
} // namespace Libraries::Vdec2
|
||||
} // namespace Libraries::Videodec2
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "common/support/avdec.h"
|
||||
|
||||
namespace Libraries::Vdec2 {
|
||||
namespace Libraries::Videodec2 {
|
||||
|
||||
std::vector<OrbisVideodec2AvcPictureInfo> gPictureInfos;
|
||||
std::vector<OrbisVideodec2LegacyAvcPictureInfo> gLegacyPictureInfos;
|
||||
@@ -278,4 +278,4 @@ AVFrame* VdecDecoder::ConvertNV12Frame(AVFrame& frame) {
|
||||
return nv12_frame;
|
||||
}
|
||||
|
||||
} // namespace Libraries::Vdec2
|
||||
} // namespace Libraries::Videodec2
|
||||
|
||||
@@ -13,7 +13,7 @@ extern "C" {
|
||||
#include <libswscale/swscale.h>
|
||||
}
|
||||
|
||||
namespace Libraries::Vdec2 {
|
||||
namespace Libraries::Videodec2 {
|
||||
|
||||
extern std::vector<OrbisVideodec2AvcPictureInfo> gPictureInfos;
|
||||
extern std::vector<OrbisVideodec2LegacyAvcPictureInfo> gLegacyPictureInfos;
|
||||
@@ -37,4 +37,4 @@ private:
|
||||
SwsContext* mSwsContext = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Libraries::Vdec2
|
||||
} // namespace Libraries::Videodec2
|
||||
Reference in New Issue
Block a user