SceCompanionUtil library + SceVoiceQoSCreateLocalEndpoint + SceVoiceQoSGetLocalEndpointAttribute + SceAudiodecTermLibrary (#194)

* libSceCompanionUtil

* sceVoiceQoSCreateLocalEndpoint + sceVoiceQoSGetLocalEndpointAttribute

* SceAudiodecTermLibrary

* +

* +

---------

Co-authored-by: red-prig <vdpasha@mail.ru>
This commit is contained in:
Ordinary205 2024-02-19 21:52:18 +04:00 committed by GitHub
parent 091deb5409
commit d12d1fba90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 144 additions and 12 deletions

View File

@ -70,6 +70,7 @@ uses
ps4_libSceWebBrowserDialog,
ps4_libSceInvitationDialog,
ps4_libSceCompanionHttpd,
ps4_libSceCompanionUtil,
ps4_libSceContentExport,
ps4_libSceConvertKeycode,
ps4_libSceUsbd,

View File

@ -253,6 +253,15 @@ begin
Result:=0;
end;
function ps4_sceAudiodecTermLibrary(uiCodecType:DWORD):Integer; SysV_ABI_CDecl;
begin
Writeln('sceAudiodecTermLibrary,uiCodecType=',uiCodecType);
if not (uiCodecType in [SCE_AUDIODEC_TYPE_AT9..SCE_AUDIODEC_TYPE_M4AAC]) then
Result:=SCE_AUDIODEC_ERROR_INVALID_TYPE
else
Result:=0;
end;
function Load_libSceAudiodec(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
@ -261,12 +270,12 @@ begin
Result.pFileName:=name;
lib:=Result._add_lib('libSceAudiodec');
lib^.set_proc($56386C9B1A5C7B32,@ps4_sceAudiodecInitLibrary);
lib^.set_proc($3B77F5B0B31646FB,@ps4_sceAudiodecCreateDecoder);
lib^.set_proc($2875C73032E420BC,@ps4_sceAudiodecDecode);
lib^.set_proc($4E9F99132EBD98B9,@ps4_sceAudiodecDeleteDecoder);
lib^.set_proc($E957FD5932C3A2CB,@ps4_sceAudiodecClearContext);
lib^.set_proc($8798D20764080D5D,@ps4_sceAudiodecTermLibrary);
end;
initialization

View File

@ -15,9 +15,6 @@ const
SCE_COMPANION_HTTPD_ERROR_INVALID_PARAM =-2132541436; //0x80E40004
type
pSceNetInPort_t=^SceNetInPort_t;
SceNetInPort_t=word;
pSceCompanionHttpdOptParam2=^SceCompanionHttpdOptParam2;
SceCompanionHttpdOptParam2=packed record
thisSize :QWORD;

View File

@ -0,0 +1,76 @@
unit ps4_libSceCompanionUtil;
{$mode ObjFPC}{$H+}
interface
uses
ps4_program,
ps4_libSceNet,
Classes,
SysUtils;
const
SCE_COMPANION_UTIL_ERROR_NO_EVENT=-2136145912; //0x80AD0008
type
pSceCompanionUtilOptParam=^SceCompanionUtilOptParam;
SceCompanionUtilOptParam=packed record
thisSize :QWORD;
workMemory :Pointer;
workMemorySize:QWORD;
end;
pSceCompanionUtilDeviceInfo=^SceCompanionUtilDeviceInfo;
SceCompanionUtilDeviceInfo=packed record
userId :Integer;
addr :SceNetSockaddrIn;
reserved:array[0..235] of char;
end;
pSceCompanionUtilEvent=^SceCompanionUtilEvent;
SceCompanionUtilEvent=packed record
event:Integer;
union:packed record
case Byte of
0:(deviceInfo:SceCompanionUtilDeviceInfo);
1:(userId :Integer);
2:(reserved :array[0..255] of char);
end;
end;
implementation
function ps4_sceCompanionUtilOptParamInitialize(pOptParam:SceCompanionUtilOptParam):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceCompanionUtilInitialize(const option:pSceCompanionUtilOptParam):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceCompanionUtilGetEvent(pEvent:pSceCompanionUtilEvent):Integer; SysV_ABI_CDecl;
begin
Result:=SCE_COMPANION_UTIL_ERROR_NO_EVENT;
end;
function Load_libSceCompanionUtil(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
begin
Result:=TElf_node.Create;
Result.pFileName:=name;
lib:=Result._add_lib('libSceCompanionUtil');
lib^.set_proc($20F37F1514AB69F9,@ps4_sceCompanionUtilOptParamInitialize);
lib^.set_proc($C5BD7194885FD106,@ps4_sceCompanionUtilInitialize);
lib^.set_proc($704E4CB32D755A15,@ps4_sceCompanionUtilGetEvent);
end;
initialization
ps4_app.RegistredPreLoad('libSceCompanionUtil.prx',@Load_libSceCompanionUtil);
end.

View File

@ -43,29 +43,43 @@ type
pSceNetSocklen_t=^SceNetSocklen_t;
SceNetSocklen_t=DWORD;
SceNetSaFamily=Byte;
pSceNetSaFamily_t=^SceNetSaFamily_t;
SceNetSaFamily_t=Byte;
pSceNetInPort_t=^SceNetInPort_t;
SceNetInPort_t=word;
pSceNetSockaddrIn=^SceNetSockaddrIn;
SceNetSockaddrIn=packed record
sin_len :Byte;
sin_family:SceNetSaFamily_t;
sin_port :SceNetInPort_t;
sin_addr :SceNetInAddr;
sin_vport :SceNetInPort_t;
sin_zero :array[0..5] of char;
end;
SceNetEpollData=packed record
Case Byte of //union
0:(ptr:Pointer);
1:(u32:DWORD);
2:(fd:Integer);
2:(fd :Integer);
3:(u64:QWORD);
end;
pSceNetSockaddr=^SceNetSockaddr;
SceNetSockaddr = packed record
sa_len:Byte;
sa_family:SceNetSaFamily;
sa_data:array[0..13] of Byte;
sa_len :Byte;
sa_family:SceNetSaFamily_t;
sa_data :array[0..13] of Byte;
end;
pSceNetEpollEvent=^SceNetEpollEvent;
SceNetEpollEvent = packed record
events:DWORD;
events :DWORD;
reserved:DWORD;
ident:QWORD;
data:SceNetEpollData;
ident :QWORD;
data :SceNetEpollData;
end;
const

View File

@ -13,6 +13,17 @@ uses
const
SCE_VOICE_ERROR_ARGUMENT_INVALID=-2142369787;
//SceVoiceQoSAttributeId
SCE_VOICE_QOS_ATTR_MIC_VOLUME =0;
SCE_VOICE_QOS_ATTR_MIC_MUTE =true;
SCE_VOICE_QOS_ATTR_SPEAKER_VOLUME =0;
SCE_VOICE_QOS_ATTR_SPEAKER_MUTE =true;
SCE_VOICE_QOS_ATTR_DESIRED_OUT_BIT_RATE=3851;
SCE_VOICE_QOS_ATTR_MIC_USABLE =false;
SCE_VOICE_QOS_ATTR_SILENT_STATE =6;
SCE_VOICE_QOS_ATTR_REMOTE_MUTE =true;
SCE_VOICE_QOS_ATTR_SPEAKER_DESTINATION =0;
//SceVoicePortType
SCE_VOICE_PORTTYPE_NULL =-1;
SCE_VOICE_PORTTYPE_IN_DEVICE =0;
@ -23,6 +34,12 @@ const
SCE_VOICE_PORTTYPE_OUT_DEVICE =5;
type
pSceVoiceQoSLocalId=^SceVoiceQoSLocalId;
SceVoiceQoSLocalId=Integer;
pSceVoiceQoSAttributeId=^SceVoiceQoSAttributeId;
SceVoiceQoSAttributeId=Integer;
pSceVoiceInitParam=^SceVoiceInitParam;
SceVoiceInitParam=packed record
appType :Integer;
@ -77,6 +94,22 @@ begin
Result:=0;
end;
function ps4_sceVoiceQoSCreateLocalEndpoint(pLocalId :pSceVoiceQoSLocalId;
userId :Integer;
deviceInId :Integer;
deviceOutId:Integer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceVoiceQoSGetLocalEndpointAttribute(LocalId :SceVoiceQoSLocalId;
attributeId :SceVoiceQoSAttributeId;
pAttributeValue:Pointer;
attributeSize :Integer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceVoiceStart(pArg:pSceVoiceStartParam):Integer; SysV_ABI_CDecl;
begin
Result:=0;
@ -171,6 +204,8 @@ begin
Result.pFileName:=name;
lib:=Result._add_lib('libSceVoiceQoS');
lib^.set_proc($53C21F365EBF0ACB,@ps4_sceVoiceQoSInit);
lib^.set_proc($96F342961347CF12,@ps4_sceVoiceQoSCreateLocalEndpoint);
lib^.set_proc($799BB644FD0C6B7C,@ps4_sceVoiceQoSGetLocalEndpointAttribute);
end;
initialization