extern "C" int main(int argc, char *argv[]) { if (loadVideoModules() < 0) { return 1; } sceMpegInit(); int result = sceMpegRingbufferConstruct((SceMpegRingbuffer *) &g_ringbuffer, 512, g_ringbufferData, sceMpegRingbufferQueryMemSize(512), &testMpegCallback, (void *) 0x1234); checkpoint("Normal: %08x", sceMpegRingbufferDestruct((SceMpegRingbuffer *) &g_ringbuffer)); checkpoint("Twice: %08x", sceMpegRingbufferDestruct((SceMpegRingbuffer *) &g_ringbuffer)); checkpoint("Invalid: %08x", sceMpegRingbufferDestruct((SceMpegRingbuffer *) 0xDEADBEEF)); checkpoint("NULL: %08x", sceMpegRingbufferDestruct(NULL)); g_ringbuffer.packetsTotal = 100; g_ringbuffer.packetsAvail = 90; g_ringbuffer.packetsRead = 2; g_ringbuffer.packetsWritten = 53; sceMpegRingbufferDestruct((SceMpegRingbuffer *) &g_ringbuffer); checkpoint(NULL); schedf("After destruct: "); schedfRingbuffer(&g_ringbuffer, g_ringbufferData); unloadVideoModules(); return 0; }
int LPP_Mp4Init(const char *mpvPath, const char *cbPath) { devkitVersion = sceKernelDevkitVersion(); if(sceUtilityLoadAvModule(0)) { #ifdef DEBUG dwrite_output("Function %s Line %d : error in sceUtilityLoadAvModule.\n", __FUNCTION__, __LINE__); #endif return -1; } if((mpegvshid = LPP_UtilsLoadStartModule(mpvPath)) <= 0) { #ifdef DEBUG dwrite_output("Function %s Line %d : Cannot load the module '%s.\n'", __FUNCTION__, __LINE__, mpvPath); #endif return -1; } if((cbridgeid = LPP_UtilsLoadStartModule(cbPath)) <= 0) { #ifdef DEBUG dwrite_output("Function %s Line %d : Cannot load the module '%s'.\n", __FUNCTION__, __LINE__, cbPath); #endif return -1; } if(sceMpegInit()) { #ifdef DEBUG dwrite_output("Function %s Line %d : error in sceMpegInit.\n", __FUNCTION__, __LINE__); #endif return -1; } return 0; }
extern "C" int main(int argc, char *argv[]) { loadPsmfPlayer(); sceMpegInit(); checkpointNext("Init"); checkpointNext("Players:"); testGetAudioData(" Initial", createPsmfPlayerInitial()); testGetAudioData(" Standby", createPsmfPlayerStandby(TEST_VIDEO_FILENAME)); testGetAudioData(" Deleted", createPsmfPlayerDeleted()); // Crashes. //testGetAudioData(" NULL", NULL); SceUID *psmfPlaying = createPsmfPlayerPlaying(TEST_VIDEO_FILENAME); testGetAudioData(" Playing", psmfPlaying); // Force the video ahead a bit. warmUpVideo(psmfPlaying); sceKernelDelayThread(16000); testGetAudioData(" Twice", psmfPlaying); SceUID psmf2 = *psmfPlaying; sceKernelDelayThread(16000); testGetAudioData(" Copy", &psmf2); testGetAudioData(" Finished", createPsmfPlayerAudioFinished(TEST_VIDEO_FILENAME)); psmfPlaying = createPsmfPlayerPlaying(TEST_VIDEO_FILENAME); warmUpVideo(psmfPlaying); checkpointNext("Params:"); // Crashes. //testGetAudioData(" NULL audioData", psmfPlaying, false); checkpointNext("Frame write"); scePsmfPlayerChangePlayMode(psmfPlaying, 3, 0); prepScanAudioData(); testGetAudioData(" Paused 1", psmfPlaying); doScanAudioData(); sceKernelDelayThread(16000); prepScanAudioData(); testGetAudioData(" Paused 2", psmfPlaying); doScanAudioData(); SceUID *psmfFinished = createPsmfPlayerAudioFinished(TEST_VIDEO_FILENAME); prepScanAudioData(); testGetAudioData(" Finished", psmfFinished); doScanAudioData(); checkpointNext("Video sync better priority:"); testAudioDataVideoSync(0x17); checkpointNext("Video sync worse priority:"); testAudioDataVideoSync(0x28); sceMpegFinish(); unloadPsmfPlayer(); return 0; }
extern "C" int main(int argc, char *argv[]) { loadPsmfPlayer(); sceMpegInit(); checkpointNext("Init"); setPsmfTests(); checkpointNext("scePsmfPlayerSetPsmfCB:"); useCB = true; setPsmfTests(); sceMpegFinish(); unloadPsmfPlayer(); return 0; }
int main(int argc, char *argv[]) { if (loadVideoModules() < 0) { return 1; } sceMpegInit(); if (createTestMpeg(512) >= 0) { registMpegStreams(0, 0); loadMpegFile("test.pmf"); testDecodeVideo(); deleteTestMpeg(); } unloadVideoModules(); return 0; }
char* load() { Alert("vload\n"); // _lcd=*ot->lcd;//save lcd context // ot->lcd->size=256;//multipl 2^6 512/576/640/704/768 ot->me->mode=(ot->dmx->width>480||ot->dmx->height>272)?5:4; if(ot->dmx->width>272)ot->lcd->type=0;//PSP_DISPLAY_PIXEL_FORMAT_565; if(ot->dmx->width>480)return "tooBig";//still playable, but too slow. modmpg=ot->sys->modload("flash0:/kd/mpeg_vsh.prx"); if(!ot->me->pool)return("noPool"); if(sceMpegInit())return("MpegIni"); if( (ot->me->buffLen=(sceMpegQueryMemSize(ot->me->mode)&0xFFFFFFF0)+16)<0)return("noMemSz"); if(!(ot->me->buff=Memalign(64,ot->me->buffLen)))return("noMpgBf"); if(sceMpegCreate(Mpeg,ot->me->buff,ot->me->buffLen,&ot->me->ring,/*cscInit*/512,ot->me->mode,(int)ot->me->pool))return("MpgCrea");//fail if ME not started if(!(ot->me->mpegAu=(SceMpegAu*)Memalign(64,64)))return("noMpgAu"); if(sceMpegInitAu(Mpeg,(ot->me->buffAu=ot->me->pool+0x10000),ot->me->mpegAu))return("MpgInit"); return NULL; }
extern "C" int main(int argc, char *argv[]) { loadPsmfPlayer(); sceMpegInit(); checkpointNext("Init"); checkpointNext("Players:"); testBreak(" Initial", createPsmfPlayerInitial()); testBreak(" Standby", createPsmfPlayerStandby()); testBreak(" Deleted", createPsmfPlayerDeleted()); // Crashes. //testBreak(" NULL", NULL); SceUID *psmfPlaying = createPsmfPlayerPlaying(); testBreak(" Playing", psmfPlaying); testBreak(" Twice", psmfPlaying); psmfPlaying = createPsmfPlayerPlaying(); SceUID psmf2 = *psmfPlaying; testBreak(" Copy", &psmf2); testBreak(" Finished", createPsmfPlayerFinished()); u64 pts = 0; checkpointNext("Pts:"); psmfPlaying = createPsmfPlayerPlaying(); warmUpVideo(psmfPlaying); testBreak(" Warm", psmfPlaying); scePsmfPlayerGetCurrentPts(psmfPlaying, &pts); checkpoint(" -> pts=%lld", pts); playPsmfPlayerUntilEnd(psmfPlaying, 10); testBreak(" Into video a bit", psmfPlaying); scePsmfPlayerGetCurrentPts(psmfPlaying, &pts); checkpoint(" -> pts=%lld", pts); runVideoABit(psmfPlaying); testBreak(" Into video a bit", psmfPlaying); scePsmfPlayerGetCurrentPts(psmfPlaying, &pts); checkpoint(" -> pts=%lld", pts); sceMpegFinish(); unloadPsmfPlayer(); return 0; }
extern "C" int main(int argc, char *argv[]) { loadPsmfPlayer(); sceMpegInit(); checkpointNext("Init"); checkpointNext("Players:"); testStop(" Initial", createPsmfPlayerInitial()); testStop(" Standby", createPsmfPlayerStandby()); testStop(" Deleted", createPsmfPlayerDeleted()); // Crashes. //testStop(" NULL", NULL); SceUID *psmfPlaying = createPsmfPlayerPlaying(); testStop(" Playing", psmfPlaying); testStop(" Twice", psmfPlaying); psmfPlaying = createPsmfPlayerPlaying(); SceUID psmf2 = *psmfPlaying; testStop(" Copy", &psmf2); testStop(" Finished", createPsmfPlayerFinished()); sceMpegFinish(); unloadPsmfPlayer(); return 0; }
extern "C" int main(int argc, char *argv[]) { loadPsmfPlayer(); sceMpegInit(); checkpointNext("Init"); checkpointNext("Players (get):"); testStart(" Initial", createPsmfPlayerInitial()); testStart(" Standby", createPsmfPlayerStandby()); // Crashes. //testStart(" NULL", NULL); // TODO: Not the most ideal test video... SceUID *psmfPlaying = createPsmfPlayerPlaying("host0:/tests/video/psmfplayer/test.pmf"); testStart(" Playing", psmfPlaying); // Force the video ahead a bit. for (int j = 0; j < 20; ++j) { u8 audioData[0x2000]; scePsmfPlayerUpdate(psmfPlaying); PsmfVideoData videoData = {0, getPsmfPlayerDisplayBuf()}; scePsmfPlayerGetVideoData(psmfPlaying, &videoData); scePsmfPlayerGetAudioData(psmfPlaying, audioData); sceKernelDelayThread(100); } testStart(" Twice", psmfPlaying); SceUID psmf2 = *psmfPlaying; testStart(" Copy", &psmf2); testStart(" Finished", createPsmfPlayerFinished()); psmf2 = 0; testStart(" Zero", &psmf2); checkpointNext("Modes:"); static const int modes[] = {-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 16, 0x80000000}; for (size_t i = 0; i < ARRAY_SIZE(modes); ++i) { char temp[64]; snprintf(temp, sizeof(temp), " Mode %d", modes[i]); testStart(temp, createPsmfPlayerStandby(), 0x0e, 0, 0x0f, 0, modes[i], 1, 0); } checkpointNext("Speeds:"); static const int speeds[] = {-2, -1, 0, 1, 2, 3, 4, 5, 10, 16, 0x80000000}; for (size_t i = 0; i < ARRAY_SIZE(speeds); ++i) { char temp[64]; snprintf(temp, sizeof(temp), " Speed %d", speeds[i]); testStart(temp, createPsmfPlayerStandby(), 0x0e, 0, 0x0f, 0, 0, speeds[i], 0); } checkpointNext("Start pts:"); static const int pts[] = {-1000, -1, 0, 1, 1000, 3003, 6006, 87087, 276276, 279278, 279279, 282282, 0x7FFFFFFF}; for (size_t i = 0; i < ARRAY_SIZE(pts); ++i) { char temp[64]; snprintf(temp, sizeof(temp), " Pts %d", pts[i]); testStart(temp, createPsmfPlayerStandby(), 0x0e, 0, 0x0f, 0, 0, 1, pts[i]); } checkpointNext("Video codecs:"); static const int videoCodecs[] = {0x00, 0x01, 0x0e, 0x0f, 0x1e, 0x8000000e}; for (size_t i = 0; i < ARRAY_SIZE(videoCodecs); ++i) { char temp[64]; snprintf(temp, sizeof(temp), " Video codec %08x", videoCodecs[i]); testStart(temp, createPsmfPlayerStandby(), videoCodecs[i], 0, 0x0f, 0, 0, 1, 0); } checkpointNext("Audio codecs (no audio):"); static const int audioCodecs[] = {0x00, 0x01, 0x0e, 0x0f, 0x1e, 0x8000000f}; for (size_t i = 0; i < ARRAY_SIZE(audioCodecs); ++i) { char temp[64]; snprintf(temp, sizeof(temp), " Audio codec %08x", audioCodecs[i]); testStart(temp, createPsmfPlayerStandby(), 0x0e, 0, audioCodecs[i], 0, 0, 1, 0); } checkpointNext("Audio codecs (with audio):"); for (size_t i = 0; i < ARRAY_SIZE(audioCodecs); ++i) { char temp[64]; snprintf(temp, sizeof(temp), " Audio codec %08x", audioCodecs[i]); testStart(temp, createPsmfPlayerStandby("host0:/tests/video/psmfplayer/test_streams.pmf"), 0x0e, 0, audioCodecs[i], 0, 0, 1, 0); } checkpointNext("Streams:"); testStart(" Video stream -1", createPsmfPlayerStandby(), 0x0e, -1, 0x0f, 0, 0, 1, 0); testStart(" Video stream 1", createPsmfPlayerStandby(), 0x0e, 1, 0x0f, 0, 0, 1, 0); testStart(" Video stream 1 (exists)", createPsmfPlayerStandby("host0:/tests/video/psmfplayer/test_streams.pmf"), 0x0e, 1, 0x0f, 0, 0, 1, 0); testStart(" Video stream 2", createPsmfPlayerStandby("host0:/tests/video/psmfplayer/test_streams.pmf"), 0x0e, 2, 0x0f, 0, 0, 1, 0); testStart(" Audio stream -1", createPsmfPlayerStandby(), 0x0e, 0, 0x0f, -1, 0, 1, 0); testStart(" Audio stream 1", createPsmfPlayerStandby(), 0x0e, 0, 0x0f, 1, 0, 1, 0); testStart(" Audio stream 1 (exists)", createPsmfPlayerStandby("host0:/tests/video/psmfplayer/test_streams.pmf"), 0x0e, 0, 0x0f, 1, 0, 1, 0); testStart(" Audio stream 2", createPsmfPlayerStandby("host0:/tests/video/psmfplayer/test_streams.pmf"), 0x0e, 0, 0x0f, 2, 0, 1, 0); sceMpegFinish(); unloadPsmfPlayer(); return 0; }