rpcsx/rpcs3/Emu/Cell/Modules/cellDmux.h

278 lines
4.6 KiB
C
Raw Normal View History

2014-01-19 11:52:30 +01:00
#pragma once
#include "Emu/Memory/vm_ptr.h"
2014-01-19 11:52:30 +01:00
// Error Codes
enum
{
CELL_DMUX_ERROR_ARG = 0x80610201,
CELL_DMUX_ERROR_SEQ = 0x80610202,
CELL_DMUX_ERROR_BUSY = 0x80610203,
CELL_DMUX_ERROR_EMPTY = 0x80610204,
CELL_DMUX_ERROR_FATAL = 0x80610205,
2014-01-19 11:52:30 +01:00
};
enum CellDmuxStreamType : s32
2014-01-19 11:52:30 +01:00
{
CELL_DMUX_STREAM_TYPE_UNDEF = 0,
CELL_DMUX_STREAM_TYPE_PAMF = 1,
CELL_DMUX_STREAM_TYPE_TERMINATOR = 2,
};
enum CellDmuxMsgType : s32
2014-01-19 11:52:30 +01:00
{
CELL_DMUX_MSG_TYPE_DEMUX_DONE = 0,
CELL_DMUX_MSG_TYPE_FATAL_ERR = 1,
CELL_DMUX_MSG_TYPE_PROG_END_CODE = 2,
};
enum CellDmuxEsMsgType : s32
2014-01-19 11:52:30 +01:00
{
CELL_DMUX_ES_MSG_TYPE_AU_FOUND = 0,
CELL_DMUX_ES_MSG_TYPE_FLUSH_DONE = 1,
};
enum CellDmuxPamfM2vLevel : s32
2014-02-24 01:00:42 +01:00
{
CELL_DMUX_PAMF_M2V_MP_LL = 0,
CELL_DMUX_PAMF_M2V_MP_ML,
CELL_DMUX_PAMF_M2V_MP_H14,
CELL_DMUX_PAMF_M2V_MP_HL,
};
enum CellDmuxPamfAvcLevel : s32
2014-02-24 01:00:42 +01:00
{
CELL_DMUX_PAMF_AVC_LEVEL_2P1 = 21,
CELL_DMUX_PAMF_AVC_LEVEL_3P0 = 30,
CELL_DMUX_PAMF_AVC_LEVEL_3P1 = 31,
CELL_DMUX_PAMF_AVC_LEVEL_3P2 = 32,
CELL_DMUX_PAMF_AVC_LEVEL_4P1 = 41,
CELL_DMUX_PAMF_AVC_LEVEL_4P2 = 42,
};
struct CellDmuxPamfAuSpecificInfoM2v
{
be_t<u32> reserved1;
};
struct CellDmuxPamfAuSpecificInfoAvc
{
be_t<u32> reserved1;
};
struct CellDmuxPamfAuSpecificInfoLpcm
{
u8 channelAssignmentInfo;
u8 samplingFreqInfo;
u8 bitsPerSample;
};
struct CellDmuxPamfAuSpecificInfoAc3
{
be_t<u32> reserved1;
};
struct CellDmuxPamfAuSpecificInfoAtrac3plus
{
be_t<u32> reserved1;
};
struct CellDmuxPamfAuSpecificInfoUserData
{
be_t<u32> reserved1;
};
struct CellDmuxPamfEsSpecificInfoM2v
{
be_t<u32> profileLevel;
};
struct CellDmuxPamfEsSpecificInfoAvc
{
be_t<u32> level;
};
struct CellDmuxPamfEsSpecificInfoLpcm
{
be_t<u32> samplingFreq;
be_t<u32> numOfChannels;
be_t<u32> bitsPerSample;
};
struct CellDmuxPamfEsSpecificInfoAc3
{
be_t<u32> reserved1;
};
struct CellDmuxPamfEsSpecificInfoAtrac3plus
{
be_t<u32> reserved1;
};
struct CellDmuxPamfEsSpecificInfoUserData
{
be_t<u32> reserved1;
};
enum CellDmuxPamfSamplingFrequency : s32
2014-02-24 01:00:42 +01:00
{
CELL_DMUX_PAMF_FS_48K = 48000,
};
enum CellDmuxPamfBitsPerSample : s32
2014-02-24 01:00:42 +01:00
{
CELL_DMUX_PAMF_BITS_PER_SAMPLE_16 = 16,
CELL_DMUX_PAMF_BITS_PER_SAMPLE_24 = 24,
};
enum CellDmuxPamfLpcmChannelAssignmentInfo : s32
2014-02-24 01:00:42 +01:00
{
CELL_DMUX_PAMF_LPCM_CH_M1 = 1,
CELL_DMUX_PAMF_LPCM_CH_LR = 3,
CELL_DMUX_PAMF_LPCM_CH_LRCLSRSLFE = 9,
CELL_DMUX_PAMF_LPCM_CH_LRCLSCS1CS2RSLFE = 11,
};
enum CellDmuxPamfLpcmFs : s32
2014-02-24 01:00:42 +01:00
{
CELL_DMUX_PAMF_LPCM_FS_48K = 1,
};
enum CellDmuxPamfLpcmBitsPerSamples : s32
2014-02-24 01:00:42 +01:00
{
CELL_DMUX_PAMF_LPCM_BITS_PER_SAMPLE_16 = 1,
CELL_DMUX_PAMF_LPCM_BITS_PER_SAMPLE_24 = 3,
};
2014-01-19 11:52:30 +01:00
struct CellDmuxMsg
{
be_t<s32> msgType; // CellDmuxMsgType
2014-01-19 11:52:30 +01:00
be_t<u64> supplementalInfo;
};
struct CellDmuxEsMsg
{
be_t<s32> msgType; // CellDmuxEsMsgType
2014-01-19 11:52:30 +01:00
be_t<u64> supplementalInfo;
};
2018-02-09 15:49:37 +01:00
struct CellDmuxType
2014-01-19 11:52:30 +01:00
{
be_t<s32> streamType; // CellDmuxStreamType
be_t<u32> reserved[2];
2014-01-19 11:52:30 +01:00
};
2014-02-24 01:00:42 +01:00
struct CellDmuxPamfSpecificInfo
{
be_t<u32> thisSize;
2015-07-26 02:53:26 +02:00
b8 programEndCodeCb;
2014-02-24 01:00:42 +01:00
};
2014-01-19 11:52:30 +01:00
struct CellDmuxType2
{
be_t<s32> streamType; // CellDmuxStreamType
2015-04-12 22:16:30 +02:00
be_t<u32> streamSpecificInfo;
2014-01-19 11:52:30 +01:00
};
struct CellDmuxResource
{
be_t<u32> memAddr;
be_t<u32> memSize;
be_t<u32> ppuThreadPriority;
be_t<u32> ppuThreadStackSize;
be_t<u32> spuThreadPriority;
be_t<u32> numOfSpus;
};
struct CellDmuxResourceEx
{
be_t<u32> memAddr;
be_t<u32> memSize;
be_t<u32> ppuThreadPriority;
be_t<u32> ppuThreadStackSize;
be_t<u32> spurs_addr;
u8 priority[8];
be_t<u32> maxContention;
};
2014-01-19 22:19:37 +01:00
/*
2014-01-19 11:52:30 +01:00
struct CellDmuxResource2Ex
{
2015-07-26 02:53:26 +02:00
b8 isResourceEx; //true
2014-01-19 11:52:30 +01:00
CellDmuxResourceEx resourceEx;
};
struct CellDmuxResource2NoEx
{
2015-07-26 02:53:26 +02:00
b8 isResourceEx; //false
2014-01-19 11:52:30 +01:00
CellDmuxResource resource;
};
2014-01-19 22:19:37 +01:00
*/
struct CellDmuxResource2
{
2015-07-26 02:53:26 +02:00
b8 isResourceEx;
2014-01-19 22:19:37 +01:00
be_t<u32> memAddr;
be_t<u32> memSize;
be_t<u32> ppuThreadPriority;
be_t<u32> ppuThreadStackSize;
be_t<u32> shit[4];
2014-01-19 22:19:37 +01:00
};
2014-01-19 11:52:30 +01:00
2015-07-26 14:10:06 +02:00
using CellDmuxCbMsg = u32(u32 demuxerHandle, vm::ptr<CellDmuxMsg> demuxerMsg, u32 cbArg);
2014-02-24 01:00:42 +01:00
2014-01-19 11:52:30 +01:00
struct CellDmuxCb
{
2018-02-09 15:49:37 +01:00
vm::bptr<CellDmuxCbMsg> cbMsgFunc;
2014-09-12 23:14:48 +02:00
be_t<u32> cbArg;
2014-01-19 11:52:30 +01:00
};
2015-07-26 14:10:06 +02:00
using CellDmuxCbEsMsg = u32(u32 demuxerHandle, u32 esHandle, vm::ptr<CellDmuxEsMsg> esMsg, u32 cbArg);
2014-02-24 01:00:42 +01:00
2014-01-19 11:52:30 +01:00
struct CellDmuxEsCb
{
2014-09-12 23:14:48 +02:00
vm::bptr<CellDmuxCbEsMsg> cbEsMsgFunc;
be_t<u32> cbArg;
2014-01-19 11:52:30 +01:00
};
struct CellDmuxAttr
{
be_t<u32> memSize;
be_t<u32> demuxerVerUpper;
be_t<u32> demuxerVerLower;
};
struct CellDmuxEsAttr
{
be_t<u32> memSize;
};
struct CellDmuxEsResource
{
be_t<u32> memAddr;
be_t<u32> memSize;
2014-01-19 11:52:30 +01:00
};
struct CellDmuxAuInfo
{
be_t<u32> auAddr;
be_t<u32> auSize;
be_t<u32> auMaxSize;
be_t<u64> userData;
2014-01-19 11:52:30 +01:00
be_t<u32> ptsUpper;
be_t<u32> ptsLower;
be_t<u32> dtsUpper;
be_t<u32> dtsLower;
};
struct CellDmuxAuInfoEx
{
be_t<u32> auAddr;
be_t<u32> auSize;
be_t<u32> reserved;
2015-07-26 02:53:26 +02:00
b8 isRap;
2014-01-19 11:52:30 +01:00
be_t<u64> userData;
2014-01-23 19:40:49 +01:00
CellCodecTimeStamp pts;
CellCodecTimeStamp dts;
2014-02-24 01:00:42 +01:00
};