From d58beb8f4c721e99655df7e2cac7f461ff82ef08 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Fri, 17 Oct 2014 16:20:40 +0300 Subject: [PATCH] Initial cellSail implementation Also a TODOs for frequencies --- rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp | 2 + rpcs3/Emu/SysCalls/Modules/cellSail.cpp | 117 +++-- rpcs3/Emu/SysCalls/Modules/cellSail.h | 527 +++++++++++++++++++++- 3 files changed, 617 insertions(+), 29 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index b25d3959b0..ff0845fb92 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -540,7 +540,9 @@ int cellGcmSetSecondVFrequency(u32 freq) switch (freq) { case CELL_GCM_DISPLAY_FREQUENCY_59_94HZ: + cellGcmSys->Todo("Unimplemented display frequency: 59.94Hz"); case CELL_GCM_DISPLAY_FREQUENCY_SCANOUT: + cellGcmSys->Todo("Unimplemented display frequency: Scanout"); case CELL_GCM_DISPLAY_FREQUENCY_DISABLE: Emu.GetGSManager().GetRender().m_frequency_mode = freq; break; diff --git a/rpcs3/Emu/SysCalls/Modules/cellSail.cpp b/rpcs3/Emu/SysCalls/Modules/cellSail.cpp index 409535dd88..29d939f90f 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSail.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSail.cpp @@ -6,9 +6,12 @@ Module *cellSail = nullptr; -int cellSailMemAllocatorInitialize() +int cellSailMemAllocatorInitialize(vm::ptr pSelf, vm::ptr pCallbacks) { - UNIMPLEMENTED_FUNC(cellSail); + cellSail->Warning("cellSailMemAllocatorInitialize(pSelf_addr=0x%x, pCallbacks_addr=0x%x)", pSelf.addr(), pCallbacks.addr()); + + pSelf->callbacks = pCallbacks; + return CELL_OK; } @@ -66,16 +69,19 @@ int cellSailDescriptorGetMediaInfo() return CELL_OK; } -int cellSailDescriptorSetAutoSelection() +int cellSailDescriptorSetAutoSelection(vm::ptr pSelf, bool autoSelection) { - UNIMPLEMENTED_FUNC(cellSail); - return CELL_OK; + cellSail->Todo("cellSailDescriptorSetAutoSelection(pSelf_addr=0x%x, autoSelection=%b)", pSelf.addr(), autoSelection); + + pSelf->autoSelection = autoSelection; + + return autoSelection; } -int cellSailDescriptorIsAutoSelection() +int cellSailDescriptorIsAutoSelection(vm::ptr pSelf) { - UNIMPLEMENTED_FUNC(cellSail); - return CELL_OK; + cellSail->Warning("cellSailDescriptorIsAutoSelection(pSelf_addr=0x%x)", pSelf.addr()); + return pSelf->autoSelection; } int cellSailDescriptorCreateDatabase() @@ -486,9 +492,18 @@ int cellSailPlayerInitialize() return CELL_OK; } -int cellSailPlayerInitialize2() +int cellSailPlayerInitialize2(vm::ptr pSelf, vm::ptr pAllocator, vm::ptr pCallback, u64 callbackArg, + vm::ptr pAttribute, vm::ptr pResource) { - UNIMPLEMENTED_FUNC(cellSail); + cellSail->Warning("cellSailPlayerInitialize2(pSelf_addr=0x%x, pAllocator_addr=0x%x, pCallback=0x%x, callbackArg=%d, pAttribute_addr=0x%x, pResource=0x%x)", pSelf.addr(), + pAllocator.addr(), pCallback.addr(), callbackArg, pAttribute.addr(), pResource.addr()); + + pSelf->allocator = pAllocator; + pSelf->callback = pCallback; + pSelf->callbackArgument = callbackArg; + pSelf->attribute = pAttribute; + pSelf->resource = pResource; + return CELL_OK; } @@ -576,34 +591,73 @@ int cellSailPlayerBoot() return CELL_OK; } -int cellSailPlayerCreateDescriptor() +int cellSailPlayerAddDescriptor(vm::ptr pSelf, vm::ptr pDesc) { - UNIMPLEMENTED_FUNC(cellSail); + cellSail->Warning("cellSailPlayerAddDescriptor(pSelf_addr=0x%x, pDesc_addr=0x%x)", pSelf.addr(), pDesc.addr()); + + if (pSelf->descriptors < 3) + { + pSelf->descriptors++; + pSelf->registeredDescriptors[pSelf->descriptors] = pDesc; + pDesc->registered = true; + } + else + { + cellSail->Error("Descriptor limit reached! This should never happen, report this to a developer."); + } + return CELL_OK; } -int cellSailPlayerDestroyDescriptor() +int cellSailPlayerCreateDescriptor(vm::ptr pSelf, s32 streamType, vm::ptr pMediaInfo, vm::ptr pUri, vm::ptr ppDesc) { - UNIMPLEMENTED_FUNC(cellSail); + cellSail->Todo("cellSailPlayerCreateDescriptor(pSelf_addr=0x%x, streamType=%d, pMediaInfo_addr=0x%x, pUri_addr=0x%x, ppDesc_addr=0x%x)", pSelf.addr(), streamType, + pMediaInfo.addr(), pUri.addr(), ppDesc.addr()); + + CellSailDescriptor *pDesc = new CellSailDescriptor(); + vm::ptr descriptor = vm::ptr::make(Memory.RealToVirtualAddr(&pDesc)); + + descriptor->streamType = streamType; + descriptor->registered = false; + + pSelf->descriptors = 0; + pSelf->repeatMode = 0; + ppDesc = descriptor; + + cellSail->Todo("pSelf_addr=0x%x, pDesc_addr=0x%x", pSelf.addr(), descriptor.addr()); + cellSailPlayerAddDescriptor(pSelf, ppDesc); + return CELL_OK; } -int cellSailPlayerAddDescriptor() +int cellSailPlayerDestroyDescriptor(vm::ptr pSelf, vm::ptr pDesc) { - UNIMPLEMENTED_FUNC(cellSail); + cellSail->Todo("cellSailPlayerAddDescriptor(pSelf_addr=0x%x, pDesc_addr=0x%x)", pSelf.addr(), pDesc.addr()); + + if (pDesc->registered) + return CELL_SAIL_ERROR_INVALID_STATE; + return CELL_OK; } -int cellSailPlayerRemoveDescriptor() +int cellSailPlayerRemoveDescriptor(vm::ptr pSelf, vm::ptr ppDesc) { - UNIMPLEMENTED_FUNC(cellSail); - return CELL_OK; + cellSail->Warning("cellSailPlayerAddDescriptor(pSelf_addr=0x%x, pDesc_addr=0x%x)", pSelf.addr(), ppDesc.addr()); + + if (pSelf->descriptors > 0) + { + ppDesc = pSelf->registeredDescriptors[pSelf->descriptors]; + delete &pSelf->registeredDescriptors[pSelf->descriptors]; + pSelf->descriptors--; + } + + return pSelf->descriptors; } -int cellSailPlayerGetDescriptorCount() +int cellSailPlayerGetDescriptorCount(vm::ptr pSelf) { - UNIMPLEMENTED_FUNC(cellSail); - return CELL_OK; + cellSail->Warning("cellSailPlayerGetDescriptorCount(pSelf_addr=0x%x)", pSelf.addr()); + return pSelf->descriptors; } int cellSailPlayerGetCurrentDescriptor() @@ -714,16 +768,23 @@ int cellSailPlayerIsPaused() return CELL_OK; } -int cellSailPlayerSetRepeatMode() +int cellSailPlayerSetRepeatMode(vm::ptr pSelf, s32 repeatMode, vm::ptr pCommand) { - UNIMPLEMENTED_FUNC(cellSail); - return CELL_OK; + cellSail->Warning("cellSailPlayerSetRepeatMode(pSelf_addr=0x%x, repeatMode=%i, pCommand_addr=0x%x)", pSelf.addr(), repeatMode, pCommand.addr()); + + pSelf->repeatMode = repeatMode; + pSelf->playbackCommand = pCommand; + + return pSelf->repeatMode; } -int cellSailPlayerGetRepeatMode() +int cellSailPlayerGetRepeatMode(vm::ptr pSelf, vm::ptr pCommand) { - UNIMPLEMENTED_FUNC(cellSail); - return CELL_OK; + cellSail->Warning("cellSailPlayerGetRepeatMode(pSelf_addr=0x%x, pCommand_addr=0x%x)", pSelf.addr(), pCommand.addr()); + + pCommand = pSelf->playbackCommand; + + return pSelf->repeatMode; } int cellSailPlayerSetEsAudioMuted() diff --git a/rpcs3/Emu/SysCalls/Modules/cellSail.h b/rpcs3/Emu/SysCalls/Modules/cellSail.h index 55dc556dc3..831a3c1218 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSail.h +++ b/rpcs3/Emu/SysCalls/Modules/cellSail.h @@ -17,6 +17,519 @@ enum CELL_SAIL_ERROR_FATAL = 0x806107FF, }; +// Call types +enum { + CELL_SAIL_PLAYER_CALL_NONE = 0, + CELL_SAIL_PLAYER_CALL_BOOT = 1, + CELL_SAIL_PLAYER_CALL_OPEN_STREAM = 2, + CELL_SAIL_PLAYER_CALL_CLOSE_STREAM = 3, + CELL_SAIL_PLAYER_CALL_OPEN_ES_AUDIO = 4, + CELL_SAIL_PLAYER_CALL_OPEN_ES_VIDEO = 5, + CELL_SAIL_PLAYER_CALL_OPEN_ES_USER = 6, + CELL_SAIL_PLAYER_CALL_CLOSE_ES_AUDIO = 7, + CELL_SAIL_PLAYER_CALL_CLOSE_ES_VIDEO = 8, + CELL_SAIL_PLAYER_CALL_CLOSE_ES_USER = 9, + CELL_SAIL_PLAYER_CALL_START = 10, + CELL_SAIL_PLAYER_CALL_STOP = 11, + CELL_SAIL_PLAYER_CALL_NEXT = 12, + CELL_SAIL_PLAYER_CALL_REOPEN_ES_AUDIO = 13, + CELL_SAIL_PLAYER_CALL_REOPEN_ES_VIDEO = 14, + CELL_SAIL_PLAYER_CALL_REOPEN_ES_USER = 15, + + _CELL_SAIL_PLAYER_CALL_TYPE_NUM_OF_ELEMENTS = 16, // Never used? +}; + +// State types +enum { + CELL_SAIL_PLAYER_STATE_INITIALIZED = 0, + CELL_SAIL_PLAYER_STATE_BOOT_TRANSITION = 1, + CELL_SAIL_PLAYER_STATE_CLOSED = 2, + CELL_SAIL_PLAYER_STATE_OPEN_TRANSITION = 3, + CELL_SAIL_PLAYER_STATE_OPENED = 4, + CELL_SAIL_PLAYER_STATE_START_TRANSITION = 5, + CELL_SAIL_PLAYER_STATE_RUNNING = 6, + CELL_SAIL_PLAYER_STATE_STOP_TRANSITION = 7, + CELL_SAIL_PLAYER_STATE_CLOSE_TRANSITION = 8, + CELL_SAIL_PLAYER_STATE_LOST = 9, + _CELL_SAIL_PLAYER_STATE_TYPE_NUM_OF_ELEMENTS = 10, // Never used? +}; + +// Preset types +enum { + CELL_SAIL_PLAYER_PRESET_AV_SYNC = 0, // Deprecated, same as 59_94HZ + CELL_SAIL_PLAYER_PRESET_AS_IS = 1, + CELL_SAIL_PLAYER_PRESET_AV_SYNC_59_94HZ = 2, + CELL_SAIL_PLAYER_PRESET_AV_SYNC_29_97HZ = 3, + CELL_SAIL_PLAYER_PRESET_AV_SYNC_50HZ = 4, + CELL_SAIL_PLAYER_PRESET_AV_SYNC_25HZ = 5, + CELL_SAIL_PLAYER_PRESET_AV_SYNC_AUTO_DETECT = 6, +}; + +// Parameter types +enum { + CELL_SAIL_PARAMETER_ENABLE_VPOST = 0, + + // Player + CELL_SAIL_PARAMETER_CONTROL_QUEUE_DEPTH = 1, + CELL_SAIL_PARAMETER_CONTROL_PPU_THREAD_PRIORITY = 2, + + // SPURS + CELL_SAIL_PARAMETER_SPURS_NUM_OF_SPUS = 3, + CELL_SAIL_PARAMETER_SPURS_SPU_THREAD_PRIORITY = 4, + CELL_SAIL_PARAMETER_SPURS_PPU_THREAD_PRIORITY = 5, + CELL_SAIL_PARAMETER_SPURS_EXIT_IF_NO_WORK = 6, + + // Source + CELL_SAIL_PARAMETER_IO_PPU_THREAD_PRIORITY = 7, + + // Dmux + CELL_SAIL_PARAMETER_DMUX_PPU_THREAD_PRIORITY = 8, + CELL_SAIL_PARAMETER_DMUX_SPU_THREAD_PRIORITY = 9, // Deprecated + CELL_SAIL_PARAMETER_DMUX_NUM_OF_SPUS = 10, + CELL_SAIL_PARAMETER_DMUX_SPURS_TASK_PRIORITIES = 11, + + // Adec + CELL_SAIL_PARAMETER_ADEC_PPU_THREAD_PRIORITY = 12, + CELL_SAIL_PARAMETER_ADEC_SPU_THREAD_PRIORITY = 13, // Deprecated + CELL_SAIL_PARAMETER_ADEC_NUM_OF_SPUS = 14, + CELL_SAIL_PARAMETER_ADEC_SPURS_TASK_PRIORITIES = 15, + + // Vdec + CELL_SAIL_PARAMETER_VDEC_PPU_THREAD_PRIORITY = 16, + CELL_SAIL_PARAMETER_VDEC_SPU_THREAD_PRIORITY = 17, // Deprecated + CELL_SAIL_PARAMETER_VDEC_M2V_NUM_OF_SPUS = 18, + CELL_SAIL_PARAMETER_VDEC_AVC_NUM_OF_SPUS = 19, + CELL_SAIL_PARAMETER_VDEC_SPURS_TASK_PRIORITIES = 20, + + // Vpost */ + CELL_SAIL_PARAMETER_VPOST_PPU_THREAD_PRIORITY = 21, // Deprecated + CELL_SAIL_PARAMETER_VPOST_SPU_THREAD_PRIORITY = 22, // Deprecated + CELL_SAIL_PARAMETER_VPOST_NUM_OF_SPUS = 23, + CELL_SAIL_PARAMETER_VPOST_SPURS_TASK_PRIORITIES = 24, + + // Graphics Adapter + CELL_SAIL_PARAMETER_GRAPHICS_ADAPTER_BUFFER_RELEASE_DELAY = 25, + + // AV Sync + CELL_SAIL_PARAMETER_AV_SYNC_ES_AUDIO = 26, + CELL_SAIL_PARAMETER_AV_SYNC_ES_VIDEO = 27, + CELL_SAIL_PARAMETER_AV_SYNC_ES_USER = 28, // Not available + + // Control + CELL_SAIL_PARAMETER_CONTROL_PPU_THREAD_STACK_SIZE = 29, + CELL_SAIL_PARAMETER_RESERVED0_ = 30, // Should be never used + CELL_SAIL_PARAMETER_RESERVED1 = 31, // Should be never used + + // Apost + CELL_SAIL_PARAMETER_ENABLE_APOST_SRC = 32, + + // File I/O Interface + CELL_SAIL_PARAMETER_FS = 33, + CELL_SAIL_PARAMETER_IO_PPU_THREAD_STACK_SIZE = 34, + CELL_SAIL_PARAMETER_VIDEO_PERFORMANCE_POLICY = 35, + _CELL_SAIL_PARAMETER_TYPE_NUM_OF_ELEMENTS = 36, // Should be never used + CELL_SAIL_PARAMETER_SOURCE_PPU_THREAD_PRIORITY = CELL_SAIL_PARAMETER_IO_PPU_THREAD_PRIORITY, + CELL_SAIL_PARAMETER_DMUX_SPURS_TASK_PRIORITY = CELL_SAIL_PARAMETER_DMUX_SPURS_TASK_PRIORITIES, // Deprecated + CELL_SAIL_PARAMETER_VDEC_SPURS_TASK_PRIORITY = CELL_SAIL_PARAMETER_VDEC_SPURS_TASK_PRIORITIES, // Deprecated + CELL_SAIL_PARAMETER_ADEC_SPURS_TASK_PRIORITY = CELL_SAIL_PARAMETER_ADEC_SPURS_TASK_PRIORITIES, // Deprecated + CELL_SAIL_PARAMETER_VPOST_SPURS_TASK_PRIORITY = CELL_SAIL_PARAMETER_VPOST_SPURS_TASK_PRIORITIES, // Deprecated +}; + +// Media states +enum { + CELL_SAIL_MEDIA_STATE_FINE = 0, + CELL_SAIL_MEDIA_STATE_BAD = 1, + CELL_SAIL_MEDIA_STATE_LOST = 2, +}; + +// Stream Types +enum +{ + CELL_SAIL_STREAM_PAMF = 0, + CELL_SAIL_STREAM_MP4 = 1, + CELL_SAIL_STREAM_AVI = 2, + + CELL_SAIL_STREAM_UNSPECIFIED = -1, +}; + +// Sync Types +enum { + CELL_SAIL_SYNC_MODE_REPEAT = 1 << 0, + CELL_SAIL_SYNC_MODE_SKIP = 1 << 1, +}; + +// Flags +enum { + CELL_SAIL_AVISF_DISABLED = 0x00000001, + CELL_SAIL_AVIF_HASINDEX = 0x00000010, + CELL_SAIL_AVIF_MUSTUSEINDEX = 0x00000020, + CELL_SAIL_AVIF_ISINTERLEAVED = 0x00000100, + CELL_SAIL_AVIF_WASCAPTUREFILE = 0x00010000, + CELL_SAIL_AVISF_VIDEO_PALCHANGES = 0x00010000, + CELL_SAIL_AVIF_COPYRIGHTED = 0x00020000, + + CELL_SAIL_AVIF_TRUSTCKTYPE = 0x00000800, // Open-DML only +}; + +// Wave types +enum { + CELL_SAIL_WAVE_FORMAT_PCM = 0x0001, + CELL_SAIL_WAVE_FORMAT_MPEG = 0x0050, + CELL_SAIL_WAVE_FORMAT_MPEGLAYER3 = 0x0055, + CELL_SAIL_WAVE_FORMAT_AC3 = 0x2000, + CELL_SAIL_WAVE_FORMAT_UNSPECIFIED = 0xFFFF, +}; + +// MPEG Layers +enum { + CELL_SAIL_ACM_MPEG_LAYER1 = 0x0001, + CELL_SAIL_ACM_MPEG_LAYER2 = 0x0002, + CELL_SAIL_ACM_MPEG_LAYER3 = 0x0004, +}; + +// MPEG Modes +enum { + CELL_SAIL_ACM_MPEG_STEREO = 0x0001, + CELL_SAIL_ACM_MPEG_JOINTSTEREO = 0x0002, + CELL_SAIL_ACM_MPEG_DUALCHANNEL = 0x0004, + CELL_SAIL_ACM_MPEG_SINGLECHANNEL = 0x0008, +}; + +// MPEG Flags +enum { + CELL_SAIL_ACM_MPEG_PRIVATEBIT = 0x0001, + CELL_SAIL_ACM_MPEG_COPYRIGHT = 0x0002, + CELL_SAIL_ACM_MPEG_ORIGINALHOME = 0x0004, + CELL_SAIL_ACM_MPEG_PROTECTIONBIT = 0x0008, + CELL_SAIL_ACM_MPEG_ID_MPEG1 = 0x0010, +}; + +// MPEG Layer 3 Flags +enum { + CELL_SAIL_MPEGLAYER3_ID_UNKNOWN = 0, + CELL_SAIL_MPEGLAYER3_ID_MPEG = 1, + CELL_SAIL_MPEGLAYER3_ID_CONSTANTFRAMESIZE = 2, + CELL_SAIL_MPEGLAYER3_FLAG_PADDING_ISO = 0x00000000, + CELL_SAIL_MPEGLAYER3_FLAG_PADDING_ON = 0x00000001, + CELL_SAIL_MPEGLAYER3_FLAG_PADDING_OFF = 0x00000002, +}; + +// ES Types +enum { + CELL_SAIL_ES_AUDIO = 0, + CELL_SAIL_ES_VIDEO = 1, + CELL_SAIL_ES_USER = 2, +}; + +// Audio Coding Types +enum { + CELL_SAIL_AUDIO_CODING_UNSPECIFIED = -1, + CELL_SAIL_AUDIO_CODING_LPCM_FLOAT32 = 1, +}; + +enum { + CELL_SAIL_AUDIO_CHNUM_UNSPECIFIED = -1, + CELL_SAIL_AUDIO_CH_NUM_UNSPECIFIED = -1, + CELL_SAIL_AUDIO_AUSAMPLE_UNSPECIFIED = -1, + CELL_SAIL_AUDIO_SAMPLE_NUM_UNSPECIFIED = -1, +}; + +enum { + CELL_SAIL_AUDIO_FS_32000HZ = 32000, + CELL_SAIL_AUDIO_FS_44100HZ = 44100, + CELL_SAIL_AUDIO_FS_48000HZ = 48000, + + CELL_SAIL_AUDIO_FS_96000HZ = 96000, + CELL_SAIL_AUDIO_FS_88200HZ = 88200, + CELL_SAIL_AUDIO_FS_64000HZ = 64000, + //CELL_SAIL_AUDIO_FS_48000HZ = 48000, + //CELL_SAIL_AUDIO_FS_44100HZ = 44100, + //CELL_SAIL_AUDIO_FS_32000HZ = 32000, + CELL_SAIL_AUDIO_FS_24000HZ = 24000, + CELL_SAIL_AUDIO_FS_22050HZ = 22050, + CELL_SAIL_AUDIO_FS_16000HZ = 16000, + CELL_SAIL_AUDIO_FS_12000HZ = 12000, + CELL_SAIL_AUDIO_FS_11025HZ = 11025, + CELL_SAIL_AUDIO_FS_8000HZ = 8000, + CELL_SAIL_AUDIO_FS_7350HZ = 7350, + + CELL_SAIL_AUDIO_FS_192000HZ = 192000, + //CELL_SAIL_AUDIO_FS_11024HZ = 11025, + CELL_SAIL_AUDIO_FS_UNSPECIFIED = -1, + +}; + +enum { + CELL_SAIL_AUDIO_CH_LAYOUT_UNDEFINED = 0, + + // monoral + CELL_SAIL_AUDIO_CH_LAYOUT_1CH = 1, + + // 1. Front Left + // 2. Front Right + CELL_SAIL_AUDIO_CH_LAYOUT_2CH_LR = 2, + + // 1. Front Left + // 2. Front Center + // 3. Front Right + // for m4aac ac3 + CELL_SAIL_AUDIO_CH_LAYOUT_3CH_LCR = 3, + + // 1. Front Left + // 2. Front Center + // 3. Surround + // for m4aac ac3 + CELL_SAIL_AUDIO_CH_LAYOUT_3CH_LRc = 4, + + // 1. Front Left + // 2. Front Center + // 3. Front Right + // 4. Surround + // for m4aac ac3 + CELL_SAIL_AUDIO_CH_LAYOUT_4CH_LCRc = 5, + + // 1. Front Left + // 2. Front Right + // 3. Surround Left + // 4. Surround Right + // for m4aac + CELL_SAIL_AUDIO_CH_LAYOUT_4CH_LRlr = 6, + + // 1. Front Left + // 2. Front Center + // 3. Front Right + // 4. Surround Left + // 5. Surround Right + // for m4aac + CELL_SAIL_AUDIO_CH_LAYOUT_5CH_LCRlr = 7, + + // 1. Front Left + // 2. Front Center + // 3. Front Right + // 4. Surround Left + // 5. Surround Right + // 6. LFE + // for lpcm ac3 m4aac + CELL_SAIL_AUDIO_CH_LAYOUT_6CH_LCRlrE = 8, + + // 1. Front Left + // 2. Front Center + // 3. Front Right + // 4. Back Left + // 5. Back Right + // 6. LFE + // for at3plus + CELL_SAIL_AUDIO_CH_LAYOUT_6CH_LCRxyE = 9, + + // 1. Front Left + // 2. Front Center + // 3. Front Right + // 4. Back Left + // 5. Back Right + // 6. Back Center + // 7. LFE + // (for at3plus) + CELL_SAIL_AUDIO_CH_LAYOUT_7CH_LCRxycE = 10, + + // 1. Front Left + // 2. Front Center + // 3. Front Right + // 4. LFE + // 5. Surround Left + // 6. Surround Right + // 7. Back Left (Left-Extend) + // 8. Back Right (Right-Extend) + // for lpcm at3plus + CELL_SAIL_AUDIO_CH_LAYOUT_8CH_LRCElrxy = 11, + + CELL_SAIL_AUDIO_CH_LAYOUT_2CH_DUAL = 12, + CELL_SAIL_AUDIO_CH_LAYOUT_UNSPECIFIED = -1, +}; + +// Video Codings +enum { + CELL_SAIL_VIDEO_CODING_UNSPECIFIED = -1, + CELL_SAIL_VIDEO_CODING_ARGB_INTERLEAVED = 0, + CELL_SAIL_VIDEO_CODING_RGBA_INTERLEAVED = 1, + CELL_SAIL_VIDEO_CODING_YUV422_U_Y0_V_Y1 = 2, + CELL_SAIL_VIDEO_CODING_YUV420_PLANAR = 3, + + // Suported by cellCamera + CELL_SAIL_VIDEO_CODING_YUV422_Y0_U_Y1_V = 4, + CELL_SAIL_VIDEO_CODING_YUV422_V_Y1_U_Y0 = 9, + CELL_SAIL_VIDEO_CODING_YUV422_Y1_V_Y0_U = 10, + CELL_SAIL_VIDEO_CODING_JPEG = 11, + CELL_SAIL_VIDEO_CODING_RAW8_BAYER_BGGR = 12, + _CELL_SAIL_VIDEO_CODING_TYPE_NUM_OF_ELEMENTS = 13, + CELL_SAIL_VIDEO_CODING_UYVY422_INTERLEAVED = 2, + CELL_SAIL_VIDEO_CODING_YUYV422_INTERLEAVED = 4, + CELL_SAIL_VIDEO_CODING_VYUY422_REVERSE_INTERLEAVED = 9, + CELL_SAIL_VIDEO_CODING_RAW8_BAYER_GRBG = 12, +}; + +// Video Color Types +enum { + CELL_SAIL_VIDEO_COLOR_MATRIX_UNSPECIFIED = -1, + CELL_SAIL_VIDEO_COLOR_MATRIX_BT601 = 0, + CELL_SAIL_VIDEO_COLOR_MATRIX_BT709 = 1, + _CELL_SAIL_VIDEO_COLOR_MATRIX_TYPE_NUM_OF_ELEMENTS = 2, +}; + +// Video Scan Types +enum { + CELL_SAIL_VIDEO_SCAN_UNSPECIFIED = -1, + CELL_SAIL_VIDEO_SCAN_PROGRESSIVE = 0, + CELL_SAIL_VIDEO_SCAN_INTERLACE = 1, + _CELL_SAIL_VIDEO_SCAN_TYPE_NUM_OF_ELEMENTS = 2, +}; + +// Framerates +enum { + CELL_SAIL_VIDEO_FRAME_RATE_UNSPECIFIED = -1, + CELL_SAIL_VIDEO_FRAME_RATE_24000_1001HZ = 0, + CELL_SAIL_VIDEO_FRAME_RATE_24HZ = 1, + CELL_SAIL_VIDEO_FRAME_RATE_25HZ = 2, + CELL_SAIL_VIDEO_FRAME_RATE_30000_1001HZ = 3, + CELL_SAIL_VIDEO_FRAME_RATE_30HZ = 4, + CELL_SAIL_VIDEO_FRAME_RATE_50HZ = 5, + CELL_SAIL_VIDEO_FRAME_RATE_60000_1001HZ = 6, + CELL_SAIL_VIDEO_FRAME_RATE_60HZ = 7, + _CELL_SAIL_VIDEO_FRAME_RATE_TYPE_NUM_OF_ELEMENTS = 8, +}; + +// Aspect Ratios +enum { + CELL_SAIL_VIDEO_ASPECT_RATIO_UNSPECIFIED = -1, + CELL_SAIL_VIDEO_ASPECT_RATIO_1_1 = 1, // 1920x1080 1280x720 + CELL_SAIL_VIDEO_ASPECT_RATIO_12_11 = 2, // 720x576 normal + CELL_SAIL_VIDEO_ASPECT_RATIO_10_11 = 3, // 720x480 normal + CELL_SAIL_VIDEO_ASPECT_RATIO_16_11 = 4, // 720x576 wide + CELL_SAIL_VIDEO_ASPECT_RATIO_40_33 = 5, // 720x480 wide + CELL_SAIL_VIDEO_ASPECT_RATIO_4_3 = 14, // 1440x1080 +}; + +enum { + CELL_SAIL_VIDEO_WIDTH_UNSPECIFIED = -1, + CELL_SAIL_VIDEO_HEIGHT_UNSPECIFIED = -1, + CELL_SAIL_VIDEO_PITCH_UNSPECIFIED = -1, + CELL_SAIL_VIDEO_BITS_PER_COLOR_UNSPECIFIED = -1, + CELL_SAIL_VIDEO_ALPHA_UNSPECIFIED = -1, +}; + +// Color Ranges +enum { + CELL_SAIL_VIDEO_COLOR_RANGE_UNSPECIFIED = -1, + CELL_SAIL_VIDEO_COLOR_RANGE_LIMITED = 1, + CELL_SAIL_VIDEO_COLOR_RANGE_FULL = 0, +}; + +enum { + CELL_SAIL_START_NOT_SPECIFIED = 0, + CELL_SAIL_START_NORMAL = 1 << 0, //1 + CELL_SAIL_START_TIME_SCALE = 1 << 2, //4 + CELL_SAIL_START_EP_SKIP = 1 << 4, //16 + CELL_SAIL_START_EP_SKIP_REVERSE = 1 << 5, //32 + CELL_SAIL_START_FRAME_STEP = 1 << 6, //64 +}; + +// Seek Types +enum { + CELL_SAIL_SEEK_NOT_SPECIFIED = 0, + CELL_SAIL_SEEK_ABSOLUTE_BYTE_POSITION = 1 << 0, // For PAMF + CELL_SAIL_SEEK_RELATIVE_BYTE_POSITION = 1 << 1, // Not implemented + CELL_SAIL_SEEK_ABSOLUTE_TIME_POSITION = 1 << 4, // MP4, AVI + CELL_SAIL_SEEK_CURRENT_POSITION = 1 << 6, + CELL_SAIL_SEEK_MP4_SCALE_AND_TIME = 1 << 4, // For MP4, obsolete +}; + +// Terminus Types +enum { + CELL_SAIL_TERMINUS_NOT_SPECIFIED = 0, + CELL_SAIL_TERMINUS_EOS = 1 << 0, + CELL_SAIL_TERMINUS_ABSOLUTE_BYTE_POSITION = 1 << 1, // For PAMF + CELL_SAIL_TERMINUS_RELATIVE_BYTE_POSITION = 1 << 2, // Mot implemented + CELL_SAIL_TERMINUS_ABSOLUTE_TIME_POSITION = 1 << 5, // For MP4, AVI + CELL_SAIL_TERMINUS_MP4_SCALE_AND_TIME = 1 << 5, // For MP4, obsolete + CELL_SAIL_TERMINUS_MP4_SCALE_ANT_TIME = 1 << 5, // For MP4, here because of a typo +}; + +// Start Flag Types +enum { + CELL_SAIL_START_FLAG_NOT_SPECIFIED = 0, + CELL_SAIL_START_FLAG_UNFLUSH = 1 << 0, + CELL_SAIL_START_FLAG_PAUSE_BEGIN = 1 << 1, + CELL_SAIL_START_FLAG_PAUSE_END = 1 << 2, + CELL_SAIL_START_FLAG_COMPLETE_STREAM = 1 << 3, + CELL_SAIL_START_FLAG_STICKY = 1 << 4, + CELL_SAIL_START_FLAG_PAUSE = 1 << 1, // Obsolete +}; + +enum { + _CELL_SAIL_SYNC_SHIFT_NUM = 8, + + // Buffering + CELL_SAIL_SYNC_UNDERFLOW = 1, + // = 2, Reserved + + // Sync Status + CELL_SAIL_SYNC_ON_TIME = 1 << 2, + CELL_SAIL_SYNC_MAYBE_ON_TIME = 2 << 2, + CELL_SAIL_SYNC_EARLY = 3 << 2, + CELL_SAIL_SYNC_LATE = 4 << 2, + CELL_SAIL_SYNC_NO_SYNC = 5 << 2, + CELL_SAIL_SYNC_NO_PTS = 6 << 2, + CELL_SAIL_SYNC_NOT_READY = 7 << 2, + CELL_SAIL_SYNC_DISABLED = 8 << 2, + CELL_SAIL_SYNC_PAUSED = 9 << 2, + CELL_SAIL_SYNC_DISABLED_PAUSED = 10 << 2, + CELL_SAIL_SYNC_MUTED = 11 << 2, + CELL_SAIL_SYNC_DONE = 12 << 2, + // = 13 << 2, Reserved + // = 14 << 2, Reserved + // = 15 << 2, Reserved + + //CELL_SAIL_SYNC_FIRST_FRAME = 64, + //CELL_SAIL_SYNC_LAST_FRAME = 128, + + + // Frame Status + CELL_SAIL_SYNC_NO_FRAME = 0, + CELL_SAIL_SYNC_REPEATED = 1 << _CELL_SAIL_SYNC_SHIFT_NUM, + CELL_SAIL_SYNC_NEXT = 2 << _CELL_SAIL_SYNC_SHIFT_NUM, + CELL_SAIL_SYNC_SKIPPED_ONE = 3 << _CELL_SAIL_SYNC_SHIFT_NUM, +}; + +enum { + CELL_SAIL_EVENT_RECORDER_CALL_COMPLETED = 2, + CELL_SAIL_EVENT_RECORDER_STATE_CHANGED = 3, +}; + + +enum { + CELL_SAIL_VIDEO_FRAME_RATE_100HZ = 8, + CELL_SAIL_VIDEO_FRAME_RATE_120000_1001HZ = 9, + CELL_SAIL_VIDEO_FRAME_RATE_120HZ = 10, +}; + +enum { + CELL_SAIL_GRAPHICS_ADAPTER_FIELD_TOP = 0, + CELL_SAIL_GRAPHICS_ADAPTER_FIELD_BOTTOM = 1, + CELL_SAIL_GRAPHICS_ADAPTER_FIELD_DONT_CARE = 2, +}; + +enum { + CELL_SAIL_SOURCE_SEEK_ABSOLUTE_BYTE_POSITION = 1 << 0, +}; + +enum { + CELL_SAIL_SOURCE_CAPABILITY_NONE = 0, + CELL_SAIL_SOURCE_CAPABILITY_SEEK_ABSOLUTE_BYTE_POSITION = 1 << 0, + CELL_SAIL_SOURCE_CAPABILITY_PAUSE = 1 << 4, + CELL_SAIL_SOURCE_CAPABILITY_GAPLESS = 1 << 5, + CELL_SAIL_SOURCE_CAPABILITY_EOS = 1 << 6, + CELL_SAIL_SOURCE_CAPABILITY_SEEK_ABSOLUTE_TIME_POSITION = 1 << 7, +}; + struct CellSailAudioFormat { s8 coding; @@ -172,7 +685,7 @@ struct CellSailMemAllocatorFuncs struct CellSailMemAllocator { - CellSailMemAllocatorFuncs callbacks; + vm::ptr callbacks; be_t pArg; }; @@ -522,6 +1035,9 @@ struct CellSailMpegLayer3WaveFormat struct CellSailDescriptor { + bool autoSelection; + bool registered; + be_t streamType; be_t internalData[32]; }; @@ -577,5 +1093,14 @@ struct CellSailPlayerResource struct CellSailPlayer { + vm::ptr allocator; + vm::ptr callback; + be_t callbackArgument; + vm::ptr attribute; + vm::ptr resource; + vm::ptr playbackCommand; + be_t repeatMode; + be_t descriptors; + vm::ptr registeredDescriptors[2]; be_t internalData[128]; }; \ No newline at end of file